Committer: vtroitsky
LJSUP-13273: Implement PromotionSlot::Journal class and DB storageU trunk/cgi-bin/LJ/Pay/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/SelfPromo.pm 2012-08-30 12:46:37 UTC (rev 12590) +++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm 2012-08-30 14:32:39 UTC (rev 12591) @@ -283,6 +283,9 @@ # also only cancel the current promotion my $object_url; if ( $current_promotion ) { +use Data::Dumper; +warn "CURR:".Dumper($current_promotion); + $class->debug_msg($slot, "current PROMO received"); $object_url = $current_promotion->object_url; my $object = $current_promotion->promoted_object; @@ -899,6 +902,9 @@ # warn "current_promotion"; die "NO SLOT" unless($slot); +use Data::Dumper; +warn "SLOT for CURR:".Dumper($slot); + my $promoid = $opts{'promoid'}; unless ($promoid) { @@ -914,6 +920,7 @@ # from_memcache = HASH(0xDEADBEEF) means bless it and return if ( defined $from_memcache ) { return unless $from_memcache; + $from_memcache->{slot} = $slot; return LJ::Pay::Promotion::Auction->new_from_row($from_memcache); } my $rows = LJ::Pay::Promotion->find_promotions( # perform select for class specific rows @@ -930,6 +937,7 @@ my $row = $rows->[0]; LJ::MemCache::set( $slot->memcache_active_key, $row, 1800 ); + $row->{slot} = $slot; return LJ::Pay::Promotion::Auction->new_from_row($row); }