holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r22828: LJSUP-13557: Top commentators on livejou...

Committer: akanashin
LJSUP-13557: Top commentators on livejournal.ru is empty
U   trunk/cgi-bin/LJ/Entry.pm
Modified: trunk/cgi-bin/LJ/Entry.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry.pm	2012-09-06 14:02:28 UTC (rev 22827)
+++ trunk/cgi-bin/LJ/Entry.pm	2012-09-06 14:07:45 UTC (rev 22828)
@@ -245,11 +245,15 @@
 sub comments_url {
     my ( $self, %opts ) = @_;
 
-    my $overridden_url;
-    LJ::run_hooks( 'override_comments_url', $self->journal, $self,
-        \$overridden_url );
-    return $overridden_url if $overridden_url;
+    my $no_override = delete $opts{no_override}; # For stream comments
 
+    unless ($no_override) {
+        my $overridden_url;
+        LJ::run_hooks( 'override_comments_url', $self->journal, $self,
+            \$overridden_url );
+        return $overridden_url if $overridden_url;
+    }
+
     my $remote     = LJ::get_remote();
     my $replycount = $self->reply_count;
 
@@ -274,19 +278,24 @@
     my $style  = delete $opts{style};
     my $nc     = delete $opts{nc};
 
+    my $no_overrides = delete $opts{no_overrides}; # For stream comments
+
     croak "Unknown args passed to url: " . join(",", keys %opts)
         if %opts;
 
-    my $override = LJ::run_hook("entry_permalink_override", $self, %opts);
-    return $override if $override;
+    unless ($no_overrides) {
+        my $override = LJ::run_hook("entry_permalink_override", $self, %opts);
+        return $override if $override;
 
-    LJ::run_hook('override_entry_url', $u, $self, \$override);
-    return $override if $override;
+        LJ::run_hook('override_entry_url', $u, $self, \$override);
+        return $override if $override;
+    } 
 
     $self->{'url'} ||= $u->journal_base . "/" . $self->ditemid . ".html";
     my $url = $self->{'url'};
 
     delete $args{anchor};
+    delete $args{no_overrides};
     if (%args) {
         $url .= "?";
         $url .= LJ::encode_url_string(\%args);

Tags: akanashin, holyandrew, 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