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
                     };
                 }
             }
--------------------------------------------------------------------------------
ninetydegrees: Art: self-portrait (Default)

Userpic missing from comments

[personal profile] ninetydegrees 2010-08-24 03:17 pm (UTC)(link)
Not sure this is caused by this patch but all userpics are now missing from comments in S2. The userpic div container gets printed but it's empty. They display fine on site-schemed pages.
kareila: (Default)

Re: Userpic missing from comments

[personal profile] kareila 2010-08-24 04:02 pm (UTC)(link)
You're right, this patch is the cause. Thanks for reporting it!
ninetydegrees: Art: does and waterfall (dear deer)

[personal profile] ninetydegrees 2010-08-24 11:50 pm (UTC)(link)
Always glad to help. :)