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

[ljcom] r11837: LJSUP-11372: Some fixes for LJ::DISABLED...

Committer: vtroitsky
LJSUP-11372: Some fixes for LJ::DISABLED{'selfpromo_ua'} flag
U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
U   trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm	2012-04-26 15:16:59 UTC (rev 11836)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm	2012-04-27 06:20:44 UTC (rev 11837)
@@ -45,8 +45,12 @@
 sub get_object_url {
     my ($self) = @_;
     $self->{promoted_object} ||= LJ::Pay::PromotedObject->new_from_cart_item($self);
-    return $self->{promoted_object}->object_url;
+#use Data::Dumper;
+#warn "ITEM:".Dumper($self);
 
+    return $self->{promoted_object} ? $self->{promoted_object}->url : '';
+
+
     # TOREMOVE: obsolete
 
     my $object = $self->get_object;
@@ -58,7 +62,7 @@
 sub get_object_owner {
     my ($self) = @_;
     $self->{promoted_object} ||= LJ::Pay::PromotedObject->new_from_cart_item($self);   #cache object creation
-    return $self->{promoted_object}->owner;
+    return $self->{promoted_object} ? $self->{promoted_object}->owner : undef;
 
     # TOREMOVE: obsolete
 

Modified: trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm	2012-04-26 15:16:59 UTC (rev 11836)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm	2012-04-27 06:20:44 UTC (rev 11837)
@@ -32,7 +32,7 @@
     $active_type = 'entry' unless ($active_type && $active_type =~ /(entry|journal|community)/);
 
     my $country = LJ::Request->get_param('country');
-    $country = PROMO_REGION_DEFAULT() unless ($country && $country =~ /(cyr|ua)/);
+   # $country = PROMO_REGION_DEFAULT() unless ($country && $country =~ /(cyr|ua)/);
 
     LJ::need_string('/shop/selfpromo.bml.confirm.delete.promoted');
     LJ::need_string('/shop/selfpromo.bml.confirm.poster.cancel');
@@ -56,8 +56,8 @@
 
         my $slot = LJ::Pay::PromotionSlot->find_slot(class => PROMO_SELF(), type => $type, region => $active_region);
 
-    use Data::Dumper;
-    warn "SLOT:".Dumper($slot);
+  #  use Data::Dumper;
+  #  warn "SLOT:".Dumper($slot);
     
         my $ml_info_title_object = LJ::Lang::ml("/shop/selfpromo.bml.info.title.$type");
 
@@ -118,7 +118,7 @@
         }
         push @{$result->{$type}}, $elem;
     }
-warn "Template params: ".Dumper($result);
+#warn "Template params: ".Dumper($result);
     return $result;
 }
 
@@ -138,7 +138,7 @@
     $type = 'entry' unless $type =~ /(entry|journal|community)/;
 
     my $country = LJ::Request->post_param('country');
-    $country = PROMO_REGION_DEFAULT() unless ($country && $country =~ /(cyr|ua)/);
+  #  $country = PROMO_REGION_DEFAULT() unless ($country && $country =~ /(cyr|ua)/);
  
     my ($promo_regions, $active_region) = LJ::Pay::PromotionSlot->find_available_promo_regions($remote, $country);
     my $promo_slot = LJ::Pay::PromotionSlot->find_slot(class => PROMO_SELF(), type => $type, region => $active_region);
@@ -190,7 +190,7 @@
     $type = 'entry' unless $type =~ /(entry|journal|community)/;
 
     my $country = LJ::Request->post_param('country');
-    $country = PROMO_REGION_DEFAULT() unless ($country && $country =~ /(cyr|ua)/);
+   # $country = PROMO_REGION_DEFAULT() unless ($country && $country =~ /(cyr|ua)/);
 
     my ($promo_regions, $active_region) = LJ::Pay::PromotionSlot->find_available_promo_regions($remote, $country);
     my $slot = LJ::Pay::PromotionSlot->find_slot(class => PROMO_SELF(), type => $type, region => $active_region);
@@ -254,7 +254,7 @@
     $data->{'country_style'} = {'ua' => 'selfpromo-ua ', PROMO_REGION_DEFAULT() => ''}->{$slot->region};
 
 
-warn "Preview template: ".Dumper($data);
+#warn "Preview template: ".Dumper($data);
 
     $template->param( 'data_selfpromo' => [ $data ] );
     return $format_result->( 'success', $template->output );

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