[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. d93b7f9a6765120804e17a1871510e4f02acab84
Stefan Hornburg
racke at rt.icdevgroup.org
Sun Mar 14 10:55:46 UTC 2010
via d93b7f9a6765120804e17a1871510e4f02acab84 (commit)
from 12ad4942ffca20f67d412492227ab34e6ed21164 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d93b7f9a6765120804e17a1871510e4f02acab84
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Sun Mar 14 11:54:59 2010 +0100
avoid server crashes when UseModifier or AutoModifier isn't specified
-----------------------------------------------------------------------
Summary of changes and diff:
lib/WellWell/Cart.pm | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/lib/WellWell/Cart.pm b/lib/WellWell/Cart.pm
index 6a8127d..97ada41 100644
--- a/lib/WellWell/Cart.pm
+++ b/lib/WellWell/Cart.pm
@@ -56,16 +56,20 @@ sub cart_item {
$product_ref = $db_products->row_hash($sku);
- for (@{$Vend::Cfg->{AutoModifier}}) {
- $item{$_} = $opt->{$_} || $product_ref->{$_};
+ if (ref($Vend::Cfg->{AutoModifier}) eq 'ARRAY') {
+ for (@{$Vend::Cfg->{AutoModifier}}) {
+ $item{$_} = $opt->{$_} || $product_ref->{$_};
+ }
}
-
- for (@{$Vend::Cfg->{UseModifier}}) {
- if (exists $opt->{$_}) {
- $item{$_} = $opt->{$_};
+
+ if (ref($Vend::Cfg->{UseModifier}) eq 'ARRAY') {
+ for (@{$Vend::Cfg->{UseModifier}}) {
+ if (exists $opt->{$_}) {
+ $item{$_} = $opt->{$_};
+ }
}
}
-
+
return \%item;
}
@@ -140,10 +144,12 @@ sub cart_refresh {
}
# checking whether any modifier changed
- for (@{$Vend::Cfg->{UseModifier}}) {
- if (exists $CGI::values{"$_$i"}
- && $CGI::values{"$_$i"} ne $itemref->{$_}) {
- $modref->{$_} = $CGI::values{"$_$i"};
+ if (ref($Vend::Cfg->{UseModifier}) eq 'ARRAY') {
+ for (@{$Vend::Cfg->{UseModifier}}) {
+ if (exists $CGI::values{"$_$i"}
+ && $CGI::values{"$_$i"} ne $itemref->{$_}) {
+ $modref->{$_} = $CGI::values{"$_$i"};
+ }
}
}
@@ -174,9 +180,11 @@ sub cart_refresh_form_action {
if ($CGI::values{mv_order_item}) {
my $opt = {};
- for (@{$Vend::Cfg->{UseModifier}}) {
- if (exists $CGI::values{"mv_order_$_"}) {
- $opt->{$_} = $CGI::values{"mv_order_$_"};
+ if (ref($Vend::Cfg->{UseModifier}) eq 'ARRAY') {
+ for (@{$Vend::Cfg->{UseModifier}}) {
+ if (exists $CGI::values{"mv_order_$_"}) {
+ $opt->{$_} = $CGI::values{"mv_order_$_"};
+ }
}
}
hooks/post-receive
--
Interchange wellwell catalog
More information about the wellwell-devel
mailing list