Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r16849: LJSV-1059 (comments not loading due to c...

Committer: ailyin
LJSV-1059 (comments not loading due to conflict in database/app counts)
U   trunk/cgi-bin/LJ/S2/EntryPage.pm
U   trunk/cgi-bin/LJ/S2.pm
Modified: trunk/cgi-bin/LJ/S2/EntryPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/EntryPage.pm	2010-06-21 08:35:46 UTC (rev 16848)
+++ trunk/cgi-bin/LJ/S2/EntryPage.pm	2010-06-21 08:55:53 UTC (rev 16849)
@@ -301,10 +301,11 @@
                 my $has_threads = scalar @{$i->{'replies'}};
                 my $poster = $i->{'poster'} ? $i->{'poster'}{'username'} : "";
                 my @child_ids = map { $_->{'talkid'} } @{$i->{'replies'}};
+                my $parent = $cmt->parent;
                 $cmtinfo->{$i->{talkid}} = {
                     rc     => \@child_ids,
                     u      => $poster,
-                    parent => $cmt->parent ? $cmt->parent->dtalkid : undef,
+                    parent => $parent && $parent->valid ? $parent->dtalkid : undef,
                     full   => ($i->{full}),
                 };
                 $self->($self, $i->{'replies'}) if $has_threads;

Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2010-06-21 08:35:46 UTC (rev 16848)
+++ trunk/cgi-bin/LJ/S2.pm	2010-06-21 08:55:53 UTC (rev 16849)
@@ -3087,7 +3087,7 @@
 
         # see if any parents are being watched
         my $watching_parent = 0;
-        while ($comment && $comment->valid && $comment->parenttalkid) {
+        while ($comment && $comment->valid && $comment->parent && $comment->parent->valid) {
             # check cache
             $comment->{_watchedby} ||= {};
             my $thread_watched = $comment->{_watchedby}->{$u->{userid}};

Tags: andy, livejournal, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments