From 72def39102b88a3db1ab1112f56b6155f38c360c Mon Sep 17 00:00:00 2001 From: Nicolas Sorosac Date: Mon, 10 Jun 2013 17:43:03 +0200 Subject: [PATCH 1/7] [-] CORE : CartRule::checkProductRestrictions : A gift product in the same category as its restrictions causes the gift to stay in the cart even if emptied --- classes/CartRule.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/CartRule.php b/classes/CartRule.php index e32bd3451..ab5cef179 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -637,7 +637,8 @@ class CartRuleCore extends ObjectModel FROM `'._DB_PREFIX_.'cart_product` cp LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product WHERE cp.`id_cart` = '.(int)$context->cart->id.' - AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')'); + AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').') + AND cp.`id_product` <> '.(int)$this->gift_product); $countMatchingProducts = 0; $matchingProductsList = array(); foreach ($cartCategories as $cartCategory) From cafbed08ee039277400c8b85e1f53cd153beb6cb Mon Sep 17 00:00:00 2001 From: MatthieuB Date: Mon, 10 Jun 2013 21:13:23 +0200 Subject: [PATCH 2/7] NewProductController: new products page must display latest products first. Override default configuration values: cause the new products page must display latest products first. --- controllers/front/NewProductsController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/front/NewProductsController.php b/controllers/front/NewProductsController.php index 7cf283eba..a438c4826 100644 --- a/controllers/front/NewProductsController.php +++ b/controllers/front/NewProductsController.php @@ -47,6 +47,13 @@ class NewProductsControllerCore extends FrontController $this->productSort(); + // Override default configuration values: cause the new products page must display latest products first. + if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby')) + { + $this->orderBy = 'date_add'; + $this->orderWay = 'DESC'; + } + $nbProducts = (int)Product::getNewProducts( $this->context->language->id, (isset($this->p) ? (int)($this->p) - 1 : null), From cd6f415dc153e821f44bea1b00e5e49a04620d14 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 13 Jun 2013 18:37:41 +0200 Subject: [PATCH 3/7] [-] BO : fixed link in AdminTracking #PSCFV-7409 --- controllers/admin/AdminTrackingController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/admin/AdminTrackingController.php b/controllers/admin/AdminTrackingController.php index 2ccb0c6ab..8ba7265a4 100644 --- a/controllers/admin/AdminTrackingController.php +++ b/controllers/admin/AdminTrackingController.php @@ -52,6 +52,9 @@ class AdminTrackingControllerCore extends AdminController public function initContent() { + if ($id_category = Tools::getValue('id_category') && Tools::getIsset('viewcategory')) + Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_category='.(int)$id_category.'&viewcategory'); + $this->_helper_list = new HelperList(); if (!Configuration::get('PS_STOCK_MANAGEMENT')) From ff876034b46b26065b06928addef6da2521dd6c7 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 14 Jun 2013 09:56:41 +0200 Subject: [PATCH 4/7] // Fixed display of the image option "legacy system" --- controllers/admin/AdminImagesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index 38ecea2e4..22694773d 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -53,7 +53,7 @@ class AdminImagesControllerCore extends AdminController ); // No need to display the old image system if the install has been made later than 2013-03-26 - $this->display_move = (defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true; + $this->display_move = (!Configuration::get('PS_LEGACY_IMAGES') && defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true; $this->fields_options = array( 'images' => array( @@ -62,7 +62,7 @@ class AdminImagesControllerCore extends AdminController 'top' => '', 'bottom' => '', 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a larger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' -

'.$this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), +

'.$this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), 'fields' => array( 'PS_IMAGE_QUALITY' => array( 'title' => $this->l('Image quality'), From 9260a43d7dd24a7594444ff310ab0fa24fa2bbae Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 14 Jun 2013 10:20:48 +0200 Subject: [PATCH 5/7] [-] INSTALLER : Shown index can return empty array --- install-dev/upgrade/php/p1540_add_missing_columns.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install-dev/upgrade/php/p1540_add_missing_columns.php b/install-dev/upgrade/php/p1540_add_missing_columns.php index a86938056..b63af1a71 100644 --- a/install-dev/upgrade/php/p1540_add_missing_columns.php +++ b/install-dev/upgrade/php/p1540_add_missing_columns.php @@ -52,9 +52,14 @@ function p1540_add_missing_columns() } $key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');; - if (is_array($key_exists)) + if (is_array($key_exists) && count($key_exists)) if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`')) $errors[] = Db::getInstance()->getMsgError(); + + $key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "id_product_2"');; + if (is_array($key_exists) && count($key_exists)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `id_product_2`')) + $errors[] = Db::getInstance()->getMsgError(); if (count($errors)) return array('error' => 1, 'msg' => implode(',', $errors)) ; From 5493010e675f15d7d21a2a2c3216e6ee85fce83b Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 14 Jun 2013 10:25:20 +0200 Subject: [PATCH 6/7] [-] BO : postcode required in manufacturer address --- controllers/admin/AdminEmployeesController.php | 2 +- controllers/admin/AdminManufacturersController.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index ebdef6a4a..3c09f4cf1 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -297,7 +297,7 @@ class AdminEmployeesControllerCore extends AdminController } $this->fields_form['input'][] = array( 'type' => 'select', - 'label' => $this->l('Profile:'), + 'label' => $this->l('Profile Permission:'), 'name' => 'id_profile', 'required' => true, 'options' => array( diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index 80d6fc516..550179b1d 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -440,6 +440,7 @@ class AdminManufacturersControllerCore extends AdminController 'type' => 'text', 'label' => $this->l('Zip Code/Postal Code'), 'name' => 'postcode', + 'required' => true, 'size' => 33, 'required' => false, ); From 331dcc4d6ef1fc25fe1d57bac08aaaf2206c2a24 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 14 Jun 2013 10:48:24 +0200 Subject: [PATCH 7/7] [-] BO : Fixed permission update #PSCFV-7441 --- controllers/admin/AdminAccessController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminAccessController.php b/controllers/admin/AdminAccessController.php index a3f79ab4b..9f636c25b 100644 --- a/controllers/admin/AdminAccessController.php +++ b/controllers/admin/AdminAccessController.php @@ -157,7 +157,7 @@ class AdminAccessControllerCore extends AdminController $sql = ' UPDATE `'._DB_PREFIX_.'access` a SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.' - WHERE `id_profile` = '.(int)$id_profile.' AND `id_tab` != '.(int)$this->id_tab_access; + WHERE `id_profile` = '.(int)$id_profile; else if ($id_tab == -1 && $perm == 'all') $sql = ' UPDATE `'._DB_PREFIX_.'access` a