fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-12-23 05:03 pm

[dw-free] Can't choose non-US country with state

[commit: http://hg.dwscoalition.org/dw-free/rev/0dac7aa067cd]

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

Clear out the string "(states/regions/territories)" if we manage to save it.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Widget/Location.pm
--------------------------------------------------------------------------------
diff -r e713bd994d2a -r 0dac7aa067cd cgi-bin/LJ/Widget/Location.pm
--- a/cgi-bin/LJ/Widget/Location.pm	Fri Dec 23 23:14:19 2011 +0800
+++ b/cgi-bin/LJ/Widget/Location.pm	Sat Dec 24 01:03:43 2011 +0800
@@ -199,9 +199,10 @@
     LJ::load_codes({ "country" => \%countries});
 
     my $state_inline_desc = $class->ml('widget.location.fn.state.inline');
+    my $state_from_dropdown = $class->ml('states.head.defined');
     my $city_inline_desc = $class->ml('widget.location.fn.city.inline');
 
-    $post->{stateother} = "" if $post->{stateother} eq $state_inline_desc;
+    $post->{stateother} = "" if $post->{stateother} eq $state_inline_desc || $post->{stateother} eq $state_from_dropdown;
     $post->{city} = "" if $post->{city} eq $city_inline_desc;
 
     my $regions_cfg = $class->country_regions_cfg($post->{'country'});
--------------------------------------------------------------------------------
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)

[personal profile] ninetydegrees 2011-12-23 05:06 pm (UTC)(link)
*crossing fingers and toes*