Committer: akanashin
LJSUP-12413: New promo product - Promo in notificationsU trunk/cgi-bin/LJ/Hooks/ESN.pm
Modified: trunk/cgi-bin/LJ/Hooks/ESN.pm =================================================================== --- trunk/cgi-bin/LJ/Hooks/ESN.pm 2012-06-18 14:44:53 UTC (rev 12126) +++ trunk/cgi-bin/LJ/Hooks/ESN.pm 2012-06-19 05:46:29 UTC (rev 12127) @@ -85,6 +85,7 @@ my $params; my $str; + eval { return if $LJ::DISABLED{notificationpromo}; my $active_region = lc($u->prop('country') || LJ::GeoLocation->get_country_info_by_ip()); @@ -105,9 +106,19 @@ my $tmpl = LJ::HTML::Template->new({use_expr => 1}, filename => "$ENV{LJHOME}/templates/Shop/$tmpl_file"); $tmpl->param( 'data_notificationpromo' => [$params] ); - return $tmpl->output(); + $str = $tmpl->output(); + }; + + if ($@) { + warn $@; + return ''; + } + + return $str; + }); + LJ::register_hook('subscriptions_manage_friend_pending_extra', sub { my $remote = shift; return LJ::Subscription::Pending->new(