sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r11457: LJSUP-11188: Error when try to promote c...

Committer: vtroitsky
LJSUP-11188: Error when try to promote community when there is no have any community: communities counter passed to template
U   trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm	2012-02-09 08:11:18 UTC (rev 11456)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm	2012-02-09 09:33:47 UTC (rev 11457)
@@ -109,8 +109,10 @@
         if ($remote && $type eq 'journal') {
             $elem->{'ljuser'} = $remote->ljuser_display();
             $elem->{'is_identity'} = $remote->is_identity;
+        } elsif ($remote && $type eq 'community') {
+            $elem->{'communities'} = [ map { {'user' => $_ } } grep { $_ ne $remote->{'user'} } LJ::get_authas_list($remote, {type => 'C'}) ];
+            $elem->{'communities_cnt'} = scalar(@{$elem->{'communities'}});
         }
-        $elem->{'communities'} = [ map { {'user' => $_ } } grep { $_ ne $remote->{'user'} } LJ::get_authas_list($remote, {type => 'C'}) ] if $remote && $type eq 'community';
         push @{$result->{$type}}, $elem;
     }
     return $result;

Tags: ljcom, pm, sunnyman, vtroitsky
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