From 5b564d2a67da0df3a8024f00478daae3cd71269f Mon Sep 17 00:00:00 2001 From: Romain Ruaud Date: Fri, 23 Sep 2016 14:41:16 +0200 Subject: [PATCH 1/4] Adding an alias for the Section Visibility usage. --- .../Request/RelevanceConfig/Structure/Element/Section.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Section.php b/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Section.php index d95204677..1088669d7 100644 --- a/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Section.php +++ b/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Section.php @@ -16,7 +16,7 @@ use Magento\Framework\AuthorizationInterface; use Magento\Framework\Module\Manager; use Magento\Store\Model\StoreManagerInterface; -use Smile\ElasticsuiteCore\Model\Search\Request\RelevanceConfig\Structure\Element\Section\Visibility; +use Smile\ElasticsuiteCore\Model\Search\Request\RelevanceConfig\Structure\Element\Section\Visibility as SectionVisibility; /** * Relevance configuration section model @@ -39,14 +39,14 @@ class Section extends \Magento\Config\Model\Config\Structure\Element\Section * @param Manager $moduleManager The module manager * @param Iterator $childrenIterator The children iterator * @param AuthorizationInterface $authorization The authorization manager - * @param Visibility $visibility The visibility manager + * @param SectionVisibility $visibility The visibility manager */ public function __construct( StoreManagerInterface $storeManager, Manager $moduleManager, Iterator $childrenIterator, AuthorizationInterface $authorization, - Visibility $visibility + SectionVisibility $visibility ) { parent::__construct($storeManager, $moduleManager, $childrenIterator, $authorization); $this->visibility = $visibility; From 6d466f70b484361121f01c56dbe73b9cd0ef8090 Mon Sep 17 00:00:00 2001 From: Fanny DECLERCK Date: Tue, 29 Nov 2016 11:58:49 +0100 Subject: [PATCH 2/4] Fix beforeSave virtual categories unserialize --- .../Attribute/Backend/VirtualRule.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php b/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php index 2b3645d47..b18cfaa77 100644 --- a/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php +++ b/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php @@ -47,15 +47,20 @@ public function beforeSave($object) $attributeCode = $this->getAttributeCode(); $attributeData = $object->getData($attributeCode); - $rule = $this->ruleFactory->create(); + if ($attributeData !== null ) { + $rule = $this->ruleFactory->create(); - if ($attributeData !== null && is_object($attributeData)) { - $rule = $attributeData; - } elseif ($attributeData !== null && is_array($attributeData)) { - $rule->loadPost($attributeData); - } + if (is_object($attributeData)) { + $rule = $attributeData; + } elseif (is_array($attributeData)) { + $rule->loadPost($attributeData); + } elseif (is_string($attributeData)) { + $attributeData = unserialize($attributeData); + $rule->getConditions()->loadArray($attributeData); + } - $object->setData($attributeCode, serialize($rule->getConditions()->asArray())); + $object->setData($attributeCode, serialize($rule->getConditions()->asArray())); + } return $this; } From 18bf06ae249b21038352ca93aa2e66ed3cb51eb8 Mon Sep 17 00:00:00 2001 From: Fanny DECLERCK Date: Tue, 29 Nov 2016 13:56:58 +0100 Subject: [PATCH 3/4] fix checktyle --- .../Model/Category/Attribute/Backend/VirtualRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php b/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php index b18cfaa77..73c721c4c 100644 --- a/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php +++ b/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Backend/VirtualRule.php @@ -47,7 +47,7 @@ public function beforeSave($object) $attributeCode = $this->getAttributeCode(); $attributeData = $object->getData($attributeCode); - if ($attributeData !== null ) { + if ($attributeData !== null) { $rule = $this->ruleFactory->create(); if (is_object($attributeData)) { From 9d1cb1bd8fd3deebbee2585800556146f143af0f Mon Sep 17 00:00:00 2001 From: Pascal Noisette Date: Tue, 29 Nov 2016 13:58:34 +0100 Subject: [PATCH 4/4] Prevent facet html value to be renderer in page. (more details were supplied by email the 2016/11/18 10:06 UTC+1) --- .../view/frontend/templates/variables/page.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module-elasticsuite-tracker/view/frontend/templates/variables/page.phtml b/src/module-elasticsuite-tracker/view/frontend/templates/variables/page.phtml index 1473b207a..5cdfa577e 100644 --- a/src/module-elasticsuite-tracker/view/frontend/templates/variables/page.phtml +++ b/src/module-elasticsuite-tracker/view/frontend/templates/variables/page.phtml @@ -21,7 +21,7 @@