From 42b5db59827129433298c489e92b04d1226eb7f8 Mon Sep 17 00:00:00 2001 From: Lewis Voncken Date: Fri, 18 Aug 2017 10:04:33 +0000 Subject: [PATCH 01/17] [BUGFIX] Flat Category reindexList of AllChildren if the url_key of the current category has changed --- app/code/Magento/Catalog/Model/Category.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 9c472385f6db4..d2010de3ffc10 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1095,6 +1095,9 @@ public function reindex() $flatIndexer = $this->indexerRegistry->get(Indexer\Category\Flat\State::INDEXER_ID); if (!$flatIndexer->isScheduled()) { $flatIndexer->reindexRow($this->getId()); + if ($this->dataHasChangedFor('url_key')) { + $flatIndexer->reindexList(explode(',', $this->getAllChildren())); + } } } $productIndexer = $this->indexerRegistry->get(Indexer\Category\Product::INDEXER_ID); From 813dca51db834b899ddffb30b8ad465372dbacf0 Mon Sep 17 00:00:00 2001 From: Lewis Voncken Date: Fri, 18 Aug 2017 10:15:08 +0000 Subject: [PATCH 02/17] [FEATURE] Change the store code in Swagger based on a param --- app/code/Magento/Swagger/Helper/Data.php | 39 +++++++++++++++++++ .../frontend/templates/swagger-ui/index.phtml | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Swagger/Helper/Data.php diff --git a/app/code/Magento/Swagger/Helper/Data.php b/app/code/Magento/Swagger/Helper/Data.php new file mode 100644 index 0000000000000..9bc53c3a2caeb --- /dev/null +++ b/app/code/Magento/Swagger/Helper/Data.php @@ -0,0 +1,39 @@ +request = $request; + parent::__construct($context); + } + + /** + * @return mixed|string + */ + public function getParamStore() + { + return ($this->request->getParam('store')) ? $this->request->getParam('store') : 'all'; + } +} \ No newline at end of file diff --git a/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml b/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml index 79040081f115d..6ef83eb116f39 100644 --- a/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml +++ b/app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml @@ -14,7 +14,7 @@ /** @var \Magento\Framework\View\Element\Template $block */ -$schemaUrl = rtrim($block->getBaseUrl(), '/') . '/rest/all/schema?services=all'; +$schemaUrl = rtrim($block->getBaseUrl(), '/') . '/rest/' . $this->helper('Magento\Swagger\Helper\Data')->getParamStore() . '/schema?services=all'; ?>