wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r7533: LJSUP-4656

Committer: wisest-owl
LJSUP-4656


U   trunk/cgi-bin/LJ/CProd/ControlStrip_Sponsored.pm
U   trunk/cgi-bin/LJ/Hooks/SUP.pm
U   trunk/cgi-bin/LJ/Hooks/Sponsored.pm
U   trunk/cgi-bin/LJ/Hooks/Userinfo.pm
Modified: trunk/cgi-bin/LJ/CProd/ControlStrip_Sponsored.pm
===================================================================
--- trunk/cgi-bin/LJ/CProd/ControlStrip_Sponsored.pm	2009-08-03 11:31:07 UTC (rev 7532)
+++ trunk/cgi-bin/LJ/CProd/ControlStrip_Sponsored.pm	2009-08-04 03:15:16 UTC (rev 7533)
@@ -13,6 +13,9 @@
     my ($class, $u, $version) = @_;
 
     my $active_journal = LJ::get_active_journal();
+    
+    return '' unless $active_journal->sponsored_u;
+    
     my $sponsor = $active_journal->sponsored_u->sponsor;
     return $sponsor->cprod_html;
 }

Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2009-08-03 11:31:07 UTC (rev 7532)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2009-08-04 03:15:16 UTC (rev 7533)
@@ -122,7 +122,7 @@
 
     # Remove BML- prefix if it exists
     $pagetype =~ s/^BML-//;
-    if ($pagetype eq 'Sponsored-Profile' && $u && $u->is_sponsored) {
+    if ($pagetype eq 'Sponsored-Profile' && $u && $u->is_sponsored && $u->sponsored_u) {
         $pagetype .= '-' . $u->sponsored_u->sponsor->community->{'user'};
     }
     $params{adzone} = $pagetype;

Modified: trunk/cgi-bin/LJ/Hooks/Sponsored.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Sponsored.pm	2009-08-03 11:31:07 UTC (rev 7532)
+++ trunk/cgi-bin/LJ/Hooks/Sponsored.pm	2009-08-04 03:15:16 UTC (rev 7533)
@@ -34,7 +34,7 @@
     my %opts = @_;
     
     my $u = $opts{user};
-    return unless LJ::isu($u) && $u->is_sponsored;
+    return unless LJ::isu($u) && $u->is_sponsored && $u->sponsored_u;
     
     my $sp = $u->sponsored_u->sponsor;
     my $spcomm = $sp->community;
@@ -75,7 +75,7 @@
     my $u = shift;
     return undef unless defined $u && LJ::isu($u);
 
-    if ($u->is_sponsored) {
+    if ($u->is_sponsored && $u->sponsored_u) {
         my $sp = $u->sponsored_u->sponsor;
         my $spc = $sp->community;
         return $spc;

Modified: trunk/cgi-bin/LJ/Hooks/Userinfo.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Userinfo.pm	2009-08-03 11:31:07 UTC (rev 7532)
+++ trunk/cgi-bin/LJ/Hooks/Userinfo.pm	2009-08-04 03:15:16 UTC (rev 7533)
@@ -37,8 +37,8 @@
     my $u = $args->{'u'};
     my $dbr = $args->{'dbr'};
     my $remote = $args->{'remote'};
-    my @ret;
-    return unless $u->in_class('sponsored');
+    my @ret = ();
+    return unless $u->in_class('sponsored') && $u->sponsored_u;
 
     my $sponsor_community = $u->sponsored_u->sponsor->community;
     $ret[0] = "$BML::ML{'ljcom.userinfo.sponsored_by'}";

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