kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2010-11-06 03:09 pm

[dw-free] Cannot change entry icon to default on edit

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

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

Correctly handle null icon keyword, to allow selection of default icon.

Patch by [personal profile] exor674.

Files modified:
  • cgi-bin/ljprotocol.pl
--------------------------------------------------------------------------------
diff -r f87a24183cba -r feae888646cf cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Fri Nov 05 21:25:32 2010 +0800
+++ b/cgi-bin/ljprotocol.pl	Sat Nov 06 10:09:16 2010 -0500
@@ -1897,8 +1897,10 @@ sub editevent
         unless common_event_validation($req, $err, $flags);
 
     # now we can move over to picture_mapid instead of picture_keyword if appropriate
-    if ( $req->{props} && $req->{props}->{picture_keyword} && $u->userpic_have_mapid ) {
-        $req->{props}->{picture_mapid} = $u->get_mapid_from_keyword( $req->{props}->{picture_keyword}, create => $flags->{create_unknown_picture_mapid} || 0 );
+    if ( $req->{props} && exists $req->{props}->{picture_keyword} && $u->userpic_have_mapid ) {
+        $req->{props}->{picture_mapid} = '';
+        $req->{props}->{picture_mapid} = $u->get_mapid_from_keyword( $req->{props}->{picture_keyword}, create => $flags->{create_unknown_picture_mapid} || 0 )
+            if $req->{props}->{picture_keyword};
         delete $req->{props}->{picture_keyword};
     }
 
--------------------------------------------------------------------------------