fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-11-29 02:29 am

[dw-free] Custom values not possible for dropdowns

[commit: http://hg.dwscoalition.org/dw-free/rev/992cad8ee52d]

http://bugs.dwscoalition.org/show_bug.cgi?id=3233

Check properly that we allow custom values before we mark a blank value as a
custom value.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Widget/S2PropGroup.pm
--------------------------------------------------------------------------------
diff -r 8cc7e00fc793 -r 992cad8ee52d cgi-bin/LJ/Widget/S2PropGroup.pm
--- a/cgi-bin/LJ/Widget/S2PropGroup.pm	Mon Nov 29 10:19:26 2010 +0800
+++ b/cgi-bin/LJ/Widget/S2PropGroup.pm	Mon Nov 29 10:29:36 2010 +0800
@@ -418,7 +418,7 @@ sub output_prop_element {
         # take the list of allowed values
         # and prepend custom values (set through the layer editor) if allowed
         my %vals = split( /\|/, $prop->{values} );
-        $vals{$override} = "Custom: " . $override unless $vals{$override};
+        $vals{$override} = "Custom: " . $override if $prop->{allow_others} && ! $vals{$override};
 
         $ret .= $class->html_select(
             { name => $name,
--------------------------------------------------------------------------------