From 5eb5df542f9244fe94dd75581eba49572fc3bc97 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 11 Dec 2018 16:37:18 +0100 Subject: [PATCH 1/8] customTpl field is not used in product filter module --- system/modules/isotope/dca/tl_module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/dca/tl_module.php b/system/modules/isotope/dca/tl_module.php index 65d1ef9631..7f2f22befb 100755 --- a/system/modules/isotope/dca/tl_module.php +++ b/system/modules/isotope/dca/tl_module.php @@ -32,7 +32,7 @@ $GLOBALS['TL_DCA']['tl_module']['palettes']['iso_wishlistviewer'] = '{title_legend},name,headline,type;{config_legend},iso_config_ids;{redirect_legend},jumpTo;{template_legend},customTpl,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['palettes']['iso_wishlistdetails'] = '{title_legend},name,headline,type;{redirect_legend:hide},iso_cart_jumpTo;{template_legend},customTpl,iso_collectionTpl,iso_orderCollectionBy,iso_gallery,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['palettes']['iso_configswitcher'] = '{title_legend},name,headline,type;{config_legend},iso_config_ids;{template_legend},customTpl,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; -$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_productfilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_enableLimit,iso_filterFields,iso_filterHideSingle,iso_searchFields,iso_searchAutocomplete,iso_sortingFields,iso_listingSortField,iso_listingSortDirection;{template_legend},customTpl,iso_filterTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['iso_productfilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_enableLimit,iso_filterFields,iso_filterHideSingle,iso_searchFields,iso_searchAutocomplete,iso_sortingFields,iso_listingSortField,iso_listingSortDirection;{template_legend},iso_filterTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['palettes']['iso_cumulativefilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_cumulativeFields,iso_filterHideSingle;{template_legend},customTpl,navigationTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['palettes']['iso_rangefilter'] = '{title_legend},name,headline,type;{config_legend},iso_category_scope,iso_list_where,iso_newFilter,iso_rangeFields;{template_legend},customTpl,navigationTpl,iso_includeMessages,iso_hide_list;{redirect_legend},jumpTo;{reference_legend:hide},defineRoot;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; $GLOBALS['TL_DCA']['tl_module']['palettes']['iso_addressbook'] = '{title_legend},name,headline,type;{config_legend},nc_notification;{template_legend},customTpl,memberTpl,tableless,iso_includeMessages;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space'; From 3b8cf1534c89468db314b204ad05a043efacb6af Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 10:42:47 +0100 Subject: [PATCH 2/8] Fixed coupon merging after member login (#1998) --- .../isotope_rules/library/Isotope/Rules.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/system/modules/isotope_rules/library/Isotope/Rules.php b/system/modules/isotope_rules/library/Isotope/Rules.php index 67cc67a4e0..6fc6efde94 100644 --- a/system/modules/isotope_rules/library/Isotope/Rules.php +++ b/system/modules/isotope_rules/library/Isotope/Rules.php @@ -341,14 +341,18 @@ public function cleanRuleUsages(&$objModule) /** * Transfer coupons from one cart to another. This happens if a guest cart is moved to user cart. - * @param IsotopeProductCollection - * @param IsotopeProductCollection - * @param array + * + * @param IsotopeProductCollection $oldCollection + * @param IsotopeProductCollection $newCollection */ - public function transferCoupons($objOldCollection, $objNewCollection, $arrIds) + public function transferCoupons(IsotopeProductCollection $oldCollection, IsotopeProductCollection $newCollection) { - if ($objOldCollection instanceof Cart && $objNewCollection instanceof Cart) { - $objNewCollection->coupons = $objOldCollection->coupons; + if ($oldCollection instanceof Cart && $newCollection instanceof Cart) { + $oldCoupons = deserialize($oldCollection->coupons, true); + $newCoupons = deserialize($newCollection->coupons, true); + + $newCollection->coupons = array_unique(array_merge($oldCoupons, $newCoupons)); + $newCollection->save(); } } From 7734ad420f0b4f513a19d78bc876246d461265b3 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 13:09:08 +0100 Subject: [PATCH 3/8] Do not count skipped checkout steps in the page title (fixes #2006) --- system/modules/isotope/library/Isotope/Module/Checkout.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/modules/isotope/library/Isotope/Module/Checkout.php b/system/modules/isotope/library/Isotope/Module/Checkout.php index 4279b3762c..6bf30d4c8d 100755 --- a/system/modules/isotope/library/Isotope/Module/Checkout.php +++ b/system/modules/isotope/library/Isotope/Module/Checkout.php @@ -328,6 +328,8 @@ protected function generateSteps(array $arrSteps) if ($this->skippableSteps[$step]) { unset($arrStepKeys[array_search($step, $arrStepKeys)]); + $intCurrentStep -= 1; + $intTotalSteps -= 1; } if ($step == $this->strCurrentStep) { From f7185ebff7e280b9db8d8aebc4e6a816b3efb7a1 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 13:42:58 +0100 Subject: [PATCH 4/8] Fixed default value for doNotCopy in DC_ProductData --- .../modules/isotope/drivers/DC_ProductData.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/drivers/DC_ProductData.php b/system/modules/isotope/drivers/DC_ProductData.php index d5fc9b8270..c487519a03 100644 --- a/system/modules/isotope/drivers/DC_ProductData.php +++ b/system/modules/isotope/drivers/DC_ProductData.php @@ -314,10 +314,22 @@ protected function copyChilds($table, $insertID, $id, $parentId) continue; } - // Reset all unique, doNotCopy and fallback fields to their default value - if ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['unique'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['doNotCopy'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['fallback']) + // Never copy passwords + if ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['inputType'] == 'password') { - $vv = ''; + $vv = \Widget::getEmptyValueByFieldType($GLOBALS['TL_DCA'][$v]['fields'][$kk]['sql']); + } + + // Empty unique fields or add a unique identifier in copyAll mode + elseif ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['unique']) + { + $vv = (\Input::get('act') == 'copyAll') ? $vv .'-'. substr(md5(uniqid(mt_rand(), true)), 0, 8) : \Widget::getEmptyValueByFieldType($GLOBALS['TL_DCA'][$v]['fields'][$kk]['sql']); + } + + // Reset doNotCopy and fallback fields to their default value + elseif ($GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['doNotCopy'] || $GLOBALS['TL_DCA'][$v]['fields'][$kk]['eval']['fallback']) + { + $vv = \Widget::getEmptyValueByFieldType($GLOBALS['TL_DCA'][$v]['fields'][$kk]['sql']); // Use array_key_exists to allow NULL (see #5252) if (array_key_exists('default', $GLOBALS['TL_DCA'][$v]['fields'][$kk])) From 5fe6779d0473e8bb39e24feb8562bed29f3455ed Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 13:59:31 +0100 Subject: [PATCH 5/8] Fixed SQL_FULL_GROUP_BY issue when duplicating products fixes #1992 --- .../isotope/dca/tl_iso_product_category.php | 1 + .../Isotope/Backend/Product/Category.php | 20 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/system/modules/isotope/dca/tl_iso_product_category.php b/system/modules/isotope/dca/tl_iso_product_category.php index 0448abd2ab..c33582e3b8 100644 --- a/system/modules/isotope/dca/tl_iso_product_category.php +++ b/system/modules/isotope/dca/tl_iso_product_category.php @@ -43,6 +43,7 @@ function() { ( 'id' => 'primary', 'pid' => 'index', + 'page_id' => 'index', ) ), ), diff --git a/system/modules/isotope/library/Isotope/Backend/Product/Category.php b/system/modules/isotope/library/Isotope/Backend/Product/Category.php index 666c2cd455..a8b75a5e68 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/Category.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/Category.php @@ -28,20 +28,18 @@ class Category extends \Backend */ public function updateSorting($insertId) { - $objCategories = \Database::getInstance()->query(' - SELECT c1.*, MAX(c2.sorting) AS max_sorting - FROM tl_iso_product_category c1 - LEFT JOIN tl_iso_product_category c2 ON c1.page_id=c2.page_id - WHERE c1.pid=' . (int) $insertId . ' - GROUP BY c1.page_id' - ); + $objCategories = \Database::getInstance()->prepare(' + SELECT id, page_id + FROM tl_iso_product_category + WHERE pid=?' + )->execute($insertId); while ($objCategories->next()) { - \Database::getInstance()->query(' + \Database::getInstance()->prepare(' UPDATE tl_iso_product_category - SET sorting=' . ($objCategories->max_sorting + 128) . ' - WHERE id=' . $objCategories->id - ); + SET sorting=(SELECT max_sorting FROM (SELECT MAX(sorting) AS max_sorting FROM tl_iso_product_category WHERE page_id=?) subq)+128 + WHERE id=?' + )->execute($objCategories->page_id, $objCategories->id); } } From f82d3f8bb148989bcbeec38961a154556ff69b26 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 14:22:35 +0100 Subject: [PATCH 6/8] Use the frontend preview event to preview category pages in Contao 4 --- .../Backend/ProductCategory/Callback.php | 4 ++++ .../library/Isotope/ContaoManager/Plugin.php | 6 ++++++ .../EventListener/FrontendPreviewListener.php | 17 +++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 system/modules/isotope/library/Isotope/EventListener/FrontendPreviewListener.php diff --git a/system/modules/isotope/library/Isotope/Backend/ProductCategory/Callback.php b/system/modules/isotope/library/Isotope/Backend/ProductCategory/Callback.php index ec7c12537d..55399b104b 100644 --- a/system/modules/isotope/library/Isotope/Backend/ProductCategory/Callback.php +++ b/system/modules/isotope/library/Isotope/Backend/ProductCategory/Callback.php @@ -47,6 +47,10 @@ public function listRows($row) */ public function getPageViewButton($href, $label, $title, $class, $attributes, $table, $root) { + if (version_compare(VERSION, '4.0', '>=')) { + return ''; + } + $objPage = \PageModel::findWithDetails(\Input::get('page_id')); if (null === $objPage) { diff --git a/system/modules/isotope/library/Isotope/ContaoManager/Plugin.php b/system/modules/isotope/library/Isotope/ContaoManager/Plugin.php index 7793e43660..57fb129f34 100644 --- a/system/modules/isotope/library/Isotope/ContaoManager/Plugin.php +++ b/system/modules/isotope/library/Isotope/ContaoManager/Plugin.php @@ -21,6 +21,12 @@ public function registerContainerConfiguration(LoaderInterface $loader, array $m ->setArguments(['%kernel.root_dir%']) ->addTag('kernel.event_listener', ['event' => 'console.terminate']) ); + + $container->setDefinition( + 'isotope.listener.frontend_preview', + (new Definition('Isotope\EventListener\FrontendPreviewListener')) + ->addTag('kernel.event_listener', ['event' => 'contao.preview_url_create', 'method' => 'onPreviewUrlCreate']) + ); }); } } diff --git a/system/modules/isotope/library/Isotope/EventListener/FrontendPreviewListener.php b/system/modules/isotope/library/Isotope/EventListener/FrontendPreviewListener.php new file mode 100644 index 0000000000..fc2a43ff1e --- /dev/null +++ b/system/modules/isotope/library/Isotope/EventListener/FrontendPreviewListener.php @@ -0,0 +1,17 @@ +getKey() !== 'iso_products' || \Input::get('table') !== 'tl_iso_product_category' || !\Input::get('page_id')) { + return; + } + + $event->setQuery('page=' . \Input::get('page_id')); + } +} From 6b7ba2fea741daba128a887723757439b0782320 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 14:28:13 +0100 Subject: [PATCH 7/8] Added Phing to sync language files --- .gitignore | 5 ++--- build.xml.dist | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 build.xml.dist diff --git a/.gitignore b/.gitignore index d274e9db7b..ae68e23bfc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,9 @@ # Do not ignore ".gitignore" !.gitignore !.tx -!README.md !composer.json -!.scrutinizer.yml -!.travis.yml +!build.xml.dist +!README.md # Isotope ignoring rules !isotope/ diff --git a/build.xml.dist b/build.xml.dist new file mode 100644 index 0000000000..0b9ce63765 --- /dev/null +++ b/build.xml.dist @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e92e559196271feabdd7650d54b1e4cb2ee66df4 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 8 Jan 2019 14:28:38 +0100 Subject: [PATCH 8/8] Release 2.5.10 --- system/modules/isotope/docs/CHANGELOG-2.5.md | 10 ++++++++++ system/modules/isotope/library/Isotope/Isotope.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.5.md b/system/modules/isotope/docs/CHANGELOG-2.5.md index fba32b52a3..be45f0549f 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.5.md +++ b/system/modules/isotope/docs/CHANGELOG-2.5.md @@ -1,6 +1,16 @@ Isotope eCommerce Changelog =========================== +Version 2.5.10-stable (2019-01-08) +---------------------------------- + +- Do not count skipped checkout steps in the page title (#2006) +- Use the frontend preview event to preview category pages in Contao 4 +- Fixed coupon merging after member login (#1998) +- Fixed SQL_FULL_GROUP_BY issue when duplicating products (#1992) +- Fixed default value for doNotCopy in DC_ProductData + + Version 2.5.9-stable (2018-11-15) --------------------------------- diff --git a/system/modules/isotope/library/Isotope/Isotope.php b/system/modules/isotope/library/Isotope/Isotope.php index cd2b841f4e..25b411ec5c 100644 --- a/system/modules/isotope/library/Isotope/Isotope.php +++ b/system/modules/isotope/library/Isotope/Isotope.php @@ -44,7 +44,7 @@ class Isotope extends \Controller /** * Isotope version */ - const VERSION = '2.5.9'; + const VERSION = '2.5.10'; /** * True if the system has been initialized