madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[ljcom] r12000: LJSUP-12304: Error 500: LiveJournal like...

Committer: sbelyaev
LJSUP-12304: Error 500: LiveJournal like button problem
U   trunk/cgi-bin/LJ/CleanHtml/Like.pm
Modified: trunk/cgi-bin/LJ/CleanHtml/Like.pm
===================================================================
--- trunk/cgi-bin/LJ/CleanHtml/Like.pm	2012-05-24 06:52:45 UTC (rev 11999)
+++ trunk/cgi-bin/LJ/CleanHtml/Like.pm	2012-05-24 07:34:46 UTC (rev 12000)
@@ -139,14 +139,16 @@
     my ($self, $params) = @_; 
     my $entry = $self->{'entry'}; 
 
-    my $give_button = LJ::run_hook("give_button", {
-                            'journal' => $entry ? $entry->journal->user : '',
-                            'itemid'  => $entry ? $entry->ditemid : 0,
-                            'type'    => 'tag',
-                        });
+    if ($entry && $entry->valid) {
+        my $give_button = LJ::run_hook("give_button", {
+                                'journal' => $entry ? $entry->journal->user : '',
+                                'itemid'  => $entry ? $entry->ditemid : 0,
+                                'type'    => 'tag',
+                            });
 
-    $params->{'lj_like.livejournal'} = 1;
-    $params->{'give_button'} = $give_button;
+        $params->{'lj_like.livejournal'} = 1;
+        $params->{'give_button'} = $give_button;
+    }
 }
 
 sub __params {

Tags: ljcom, madeon, pm, sbelyaev
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