[dw-free] Styles: customizing stuff also save blank settings which means later changes aren't applie
[commit: http://hg.dwscoalition.org/dw-free/rev/d123913d01f7]
http://bugs.dwscoalition.org/show_bug.cgi?id=4472
The S2 wizard tried to detect default values and ignore them. The problem
was that equality was defined as either "both are undef" or "both are
defined but the same".
There is a corner case though: if the style has no default (undefined), and
the user has no default (which might show up as undef and catch in the above
case) or it might be defined but the empty string -- which is not a value in
this context and should be treated as undef.
Patch by
mark.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=4472
The S2 wizard tried to detect default values and ignore them. The problem
was that equality was defined as either "both are undef" or "both are
defined but the same".
There is a corner case though: if the style has no default (undefined), and
the user has no default (which might show up as undef and catch in the above
case) or it might be defined but the empty string -- which is not a value in
this context and should be treated as undef.
Patch by
Files modified:
- cgi-bin/LJ/Customize.pm
--------------------------------------------------------------------------------
diff -r 743747b69778 -r d123913d01f7 cgi-bin/LJ/Customize.pm
--- a/cgi-bin/LJ/Customize.pm Fri Jun 15 20:19:05 2012 +0000
+++ b/cgi-bin/LJ/Customize.pm Fri Jun 15 20:52:13 2012 +0000
@@ -500,6 +500,12 @@
next if ! defined $prop_value and ! defined $prop_values{existing};
next if defined $prop_value and defined $prop_values{existing}
and $prop_value eq $prop_values{existing};
+
+ # special case: if the style doesn't define a value, and the user has a defined-but
+ # blank or empty value, skip it
+ next if ! defined $prop_values{existing} && defined $prop_value &&
+ length($prop_value) == 0;
+
$override{$name} = [ $prop, $prop_value ];
}
--------------------------------------------------------------------------------
