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-04-02 03:40 am

[dw-free] shop mistyping accounts added to cart

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

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

Don't delete the type -- causes weird problems because the items forget what
they are.

Patch by [staff profile] mark.

Files modified:
  • cgi-bin/DW/Shop/Item.pm
--------------------------------------------------------------------------------
diff -r 48f587fb446f -r c92b1f233edf cgi-bin/DW/Shop/Item.pm
--- a/cgi-bin/DW/Shop/Item.pm	Wed Mar 31 17:09:32 2010 -0500
+++ b/cgi-bin/DW/Shop/Item.pm	Fri Apr 02 03:40:35 2010 +0000
@@ -59,9 +59,7 @@ for an example.
 
 sub new {
     my ( $class, %args ) = @_;
-
-    my $type = delete $args{type};
-    return undef unless exists $LJ::SHOP{$type};
+    return undef unless exists $LJ::SHOP{$args{type}};
 
     # from_userid will be 0 if the sender isn't logged in
     return undef unless $args{from_userid} == 0 || LJ::load_userid( $args{from_userid} );
@@ -100,7 +98,7 @@ sub new {
     # looks good
     return bless {
         # user supplied arguments (close enough)
-        cost    => $LJ::SHOP{$type}->[0] + 0.00,
+        cost    => $LJ::SHOP{$args{type}}->[0] + 0.00,
         %args,
 
         # internal things we use to track the state of this item,
--------------------------------------------------------------------------------