журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[livejournal] r22676: LJSUP-13323: Fix empty selfpromo params ...

Committer: nnikulochkina
LJSUP-13323: Fix empty selfpromo params in XML-RPC get*ratings functions
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-08-16 12:19:47 UTC (rev 22675)
+++ trunk/cgi-bin/ljprotocol.pl	2012-08-16 12:50:18 UTC (rev 22676)
@@ -5792,18 +5792,22 @@
             title            => $row->{name_raw},
         }
     }
-   
-    if ($req->{getselfpromo}) {
-        return fail($err, 500) unless $res->{selfpromo} && ref $res->{selfpromo};
-      
-        my $sp = $res->{selfpromo}->get_template_params();
+           
+    if (my $sp = $res->{selfpromo} && $res->{selfpromo}->get_template_params ) {
+
+        $selfpromo = {
+            # selfpromo data
+            remaning_time    => $sp->{timeleft},
+            price            => $sp->{buyout},
+        };
+
+        $sp = $sp->{object}->[0];
+
         $sp->{userid} = delete $sp->{journal_id} if  $sp->{journal_id};
         LJ::get_aggregated_user($sp, $user_opts);
 
         $selfpromo = {
-            # selfpromo data
-            remaning_time    => $sp->{timeleft}, 
-            price            => $sp->{buyout},
+            %$selfpromo,
             # user data
             username         => $sp->{username},
             identity_display => $sp->{display_name},
@@ -5812,7 +5816,7 @@
             identity_value   => $sp->{identity_value},
             userpic_url      => $sp->{userpic} ? $sp->{userpic}->url : '',
             journal_url      => $sp->{journal_base},
-            userhead_url     => $sp->{userhead_url},
+            userhead_url     => $sp->{headicon},
             title            => $sp->{name_raw},
         };
     }

Tags: livejournal, nikulochkina, nnikulochkina, pl
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