Update body and subject if the comment body is blank (we can't submit 
blank comments, so this is likely an indication that something went wrong with 
the import).

        Patch by fu. 

diffs (18 lines):

diff -r 89fe44e3e37a -r faebcc7f9e5c 
cgi-bin/DW/Worker/ContentImporter/Local/Comments.pm
--- a/cgi-bin/DW/Worker/ContentImporter/Local/Comments.pm       Thu Nov 11 
13:43:33 2010 +0800
+++ b/cgi-bin/DW/Worker/ContentImporter/Local/Comments.pm       Fri Nov 12 
17:27:11 2010 +0800
@@ -71,6 +71,14 @@ sub update_comment {
     # edits and such.  for now, I'm just trying to get the icons to update...
     my $c = LJ::Comment->instance( $u, jtalkid => $cmt->{id} )
         or return $$errref = 'Unable to instantiate LJ::Comment object.';
+
+    # so we don't load the bodies of every comment ever
+    # (most of the time, we don't need to)
+    # empty body of a nondeleted comment indicates something went wrong with 
the import process
+    if ( $LJ::FIX_COMMENT_IMPORT{$u->user} && ! $c->is_deleted && $c->body_raw 
== "" ) {
+        $c->set_subject_and_body( $cmt->{subject}, $cmt->{body} );
+    }
+
     my $pu = $c->poster;
     if ( $pu && $pu->userpic_have_mapid ) {
         $c->set_prop( picture_mapid => $u->get_mapid_from_keyword( 
$cmt->{props}->{picture_keyword}, create => 1 ) );
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to