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-29 04:36 am

[dw-free] Comment "Don't autoformat" option cannot be removed upon edit

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

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

Instead of deleting from the hash, set to undef, so that set_props is still
aware that it needs to process these (and delete them from the DB if they
exist)

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Talk.pm
--------------------------------------------------------------------------------
diff -r 19683eca0390 -r 0a44f7843dbc cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm	Wed Dec 28 19:32:27 2011 +0800
+++ b/cgi-bin/LJ/Talk.pm	Thu Dec 29 12:37:04 2011 +0800
@@ -3892,8 +3892,8 @@
         edit_reason => $comment->{editreason},
     );
 
-    # remove blank/0 values (defaults)
-    foreach ( keys %props ) { delete $props{$_} unless $props{$_}; }
+    # set to undef if we have blank/0 values (set_props will delete these from the DB later)
+    foreach ( keys %props ) { $props{$_} = undef unless $props{$_}; }
 
     my $pu = $comment_obj->poster;
     if ( $pu && $pu->userpic_have_mapid ) {
--------------------------------------------------------------------------------