mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2010-01-29 10:26 pm

[dw-free] holiday paid time promo not ending properly

[commit: http://hg.dwscoalition.org/dw-free/rev/ba1d829e2be8]

http://bugs.dwscoalition.org/show_bug.cgi?id=2312

The blurb went away when the promo expired, but the actual logic didn't.
Fix that.

Patch by [staff profile] mark.

Files modified:
  • cgi-bin/DW/Hooks/HolidayPromotion.pm
--------------------------------------------------------------------------------
diff -r ba6815d20834 -r ba1d829e2be8 cgi-bin/DW/Hooks/HolidayPromotion.pm
--- a/cgi-bin/DW/Hooks/HolidayPromotion.pm	Thu Jan 21 15:54:02 2010 +0000
+++ b/cgi-bin/DW/Hooks/HolidayPromotion.pm	Fri Jan 29 22:26:18 2010 +0000
@@ -36,6 +36,9 @@ LJ::Hooks::register_hook( 'shop_cart_sta
 # hook to add a new item when they purchase somethign eligibile
 LJ::Hooks::register_hook( 'shop_cart_added_item', sub {
     my ( $cart, $item ) = @_;
+
+    # bail out if it's expired (2010-01-01 00:00:00)
+    return if time > 1262304000;
 
     # ignore promo linked items so we don't loop forever
     return if $item->{_holiday_promo_2009};
--------------------------------------------------------------------------------