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

[dw-free] clean up error logs

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

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

We know what's causing this now; we can remove the warning.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/LJ/S2/EntryPage.pm
--------------------------------------------------------------------------------
diff -r 905f5413bcd2 -r 92e96536bf99 cgi-bin/LJ/S2/EntryPage.pm
--- a/cgi-bin/LJ/S2/EntryPage.pm	Fri Aug 20 14:00:14 2010 -0500
+++ b/cgi-bin/LJ/S2/EntryPage.pm	Mon Aug 23 11:07:49 2010 +0800
@@ -17,8 +17,6 @@
 
 use strict;
 package LJ::S2;
-
-use Carp;
 
 # these are needed for S2::PROPS
 use DW;
@@ -98,14 +96,12 @@ sub EntryPage
     my $view_num = ($view_arg =~ /(\d+)/) ? $1 : undef;
 
     my %userpic;
-    my %user;
     my $copts = {
         'flat' => $flat_mode,
         'thread' => ($get->{'thread'} >> 8),
         'page' => $get->{'page'},
         'view' => $view_num,
         'userpicref' => \%userpic,
-        'userref' => \%user,
         # user object is cached from call just made in EntryPage_entry
         'up' => LJ::load_user($s2entry->{'poster'}->{'user'}),
         'viewall' => $viewall,
@@ -131,8 +127,7 @@ sub EntryPage
         my ($self, $destlist, $srclist, $depth) = @_;
 
         foreach my $com (@$srclist) {
-            my $pu = $com->{'posterid'} ? $user{$com->{'posterid'}} : undef;
-
+            my $pu = $com->{upost};
             my $dtalkid = $com->{'talkid'} * 256 + $entry->anum;
             my $text = LJ::CleanHTML::quote_html( $com->{body}, $get->{nohtml} );
 
@@ -206,18 +201,14 @@ sub EntryPage
                 if ($pu) {
                     $poster = UserLite($pu);
                 } else {
-                    # I can't determine where this code is called, if it ever is?  so for now,
-                    # let's spit out a backtrace so we can figure out how this case happens.  we need
-                    # to fix it since the journal_type is wrong in some cases.
-                    # FIXME: watch logs
-                    Carp::cluck "LJ::S2::EntryPage faked a UserLite; userpost=$com->{userpost}:";
-                    
+                    # posterid is invalid userid
+                    # we don't have the info, so fake a UserLite
                     $poster = {
-                        '_type' => 'UserLite',
-                        'username' => $com->{'userpost'},
-                        'user' => $com->{'userpost'},
-                        'name' => $com->{'userpost'},  # we don't have this, so fake it
-                        'journal_type' => 'P',         # fake too, but only people can post, so correct
+                        _type => 'UserLite',
+                        username => undef,
+                        user => undef,
+                        name => undef,
+                        journal_type => 'P',  # best guess
                     };
                 }
             }
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org