[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 templateU 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;
