From 1031883fbf0dfd3c8dd31d2f7d6f1e1c95dc6f54 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 21 Jul 2008 21:27:31 +0000 Subject: [PATCH] Change the order of deleting the item from the cache and calling clean up code, since deleting the item causes the Session var to get nuked. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Shop/Cart.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8232c202b..566025bd7 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -20,6 +20,7 @@ - fixed: i18nagain - fixed: Cash available as a payment option to everyone - fixed: Web::Form::Asset can now accept assets with '|" in their names. + - fixed: Shop: remove an item and Apache segfaults 7.5.17 - fixed: Payment Methods Hover Help Incomplete diff --git a/lib/WebGUI/Shop/Cart.pm b/lib/WebGUI/Shop/Cart.pm index e581415a5..d32ebeaca 100644 --- a/lib/WebGUI/Shop/Cart.pm +++ b/lib/WebGUI/Shop/Cart.pm @@ -633,8 +633,8 @@ Remove an item from the cart and then display the cart again. sub www_removeItem { my $self = shift; my $item = $self->getItem($self->session->form->get("itemId")); - delete $itemCache{ref $self}{$item->getId}; $item->remove; + delete $itemCache{ref $self}{$item->getId}; return $self->www_view; }