From 53526304a5ac23bb0878c0cb8637492460bb3c32 Mon Sep 17 00:00:00 2001 From: Corentin Delcourt Date: Thu, 25 Jul 2013 14:37:27 +0200 Subject: [PATCH] [-] WS: Sanity check before creating packs As it is before this commit, every product that is created from the schema without removing the empty bundle item in the schema will become a pack containing one broken item. Sorry, this bug was introduced by my previous pull request. --- classes/Product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index de39624d2..d69a28e0c 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -5377,7 +5377,8 @@ class ProductCore extends ObjectModel Pack::deleteItems($this->id); foreach ($items as $item) - Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']); + if((int)$item['id'] > 0) + Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']); return true; } }