From 074285735cd6d33fd530302390ab8101e73d7e34 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:51:13 -0600 Subject: [PATCH 01/10] :arrow_double_up: Forwardport of magento/magento2#11219 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11219.patch (created by @mszydlo) based on commit(s): 1. c1c5796bcf467584833ac49fc40f74187b89973b --- .../Magento/Theme/view/frontend/templates/js/polyfill.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml b/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml index 7e8854b914261..2b75bd2222e26 100644 --- a/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/js/polyfill.phtml @@ -126,7 +126,7 @@ }; window.localStorage.__proto__ = window.localStorage = new Storage('local'); - window.sessionStorage.__proto__ = window.sessionStorag = new Storage('session'); + window.sessionStorage.__proto__ = window.sessionStorage = new Storage('session'); })(); } From fde512eacfce36508bcec2b1c08ef381d0af3f92 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:51:22 -0600 Subject: [PATCH 02/10] :arrow_double_up: Forwardport of magento/magento2#11345 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11345.patch (created by @davidangel) based on commit(s): 1. dd6e5a36e2a3bcc1167d12897686fdb9ce1caa3d 2. 4092346a9505d190faf65930b63db881c3e3b5fd 3. 84ff52beb4adb70024060179ddff3eb1776e47db --- app/code/Magento/Cms/i18n/en_US.csv | 2 +- .../Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml | 2 +- .../app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Cms/i18n/en_US.csv b/app/code/Magento/Cms/i18n/en_US.csv index 983493bb7732a..e4989777593f8 100644 --- a/app/code/Magento/Cms/i18n/en_US.csv +++ b/app/code/Magento/Cms/i18n/en_US.csv @@ -133,7 +133,7 @@ Block,Block "Enable Page","Enable Page" Content,Content "Content Heading","Content Heading" -"Search Engine Optimisation","Search Engine Optimisation" +"Search Engine Optimization","Search Engine Optimization" "Meta Title","Meta Title" "Meta Keywords","Meta Keywords" "Meta Description","Meta Description" diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml index f8c4f07bd4336..5441481f6cea2 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml @@ -141,7 +141,7 @@
true - + diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml index 2ed1bdc790806..28de286b1411a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml @@ -68,7 +68,7 @@ \Magento\Backend\Test\Block\Widget\Tab - //div[div/strong/span[text()="Search Engine Optimisation"]] + //div[div/strong/span[text()="Search Engine Optimization"]] xpath From e7d90de918be70731e2021dee757d1e7af374ab8 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:51:31 -0600 Subject: [PATCH 03/10] :arrow_double_up: Forwardport of magento/magento2#11183 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11183.patch (created by @larsroettig) based on commit(s): 1. fb2ec44114e113d959d4b098cf7b2e1660e51cde 2. 214fc33862252bbbfbe0da781b2f3383cb5eac87 Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#11166: ReindexAll -> getState() is not correct if the Indexer broke with PHP fatal error (reported by @larsroettig) --- app/code/Magento/Indexer/Model/Indexer.php | 5 ++ .../Indexer/Test/Unit/Model/IndexerTest.php | 50 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/app/code/Magento/Indexer/Model/Indexer.php b/app/code/Magento/Indexer/Model/Indexer.php index 412611d1dffd6..9faf5e7b728cd 100644 --- a/app/code/Magento/Indexer/Model/Indexer.php +++ b/app/code/Magento/Indexer/Model/Indexer.php @@ -418,6 +418,11 @@ public function reindexAll() $state->save(); $this->getView()->resume(); throw $exception; + } catch (\Error $error) { + $state->setStatus(StateInterface::STATUS_INVALID); + $state->save(); + $this->getView()->resume(); + throw $error; } } } diff --git a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php index 2c25c698dd425..e9c82906121cc 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php @@ -273,6 +273,56 @@ function () { $this->model->reindexAll(); } + /** + * @expectedException \Error + * @expectedExceptionMessage Test Engine Error + */ + public function testReindexAllWithError() + { + + $indexId = 'indexer_internal_name'; + $this->loadIndexer($indexId); + + $stateMock = $this->createPartialMock( + \Magento\Indexer\Model\Indexer\State::class, + ['load', 'getId', 'setIndexerId', '__wakeup', 'getStatus', 'setStatus', 'save'] + ); + $stateMock->expects($this->once())->method('load')->with($indexId, 'indexer_id')->will($this->returnSelf()); + $stateMock->expects($this->never())->method('setIndexerId'); + $stateMock->expects($this->once())->method('getId')->will($this->returnValue(1)); + $stateMock->expects($this->exactly(2))->method('setStatus')->will($this->returnSelf()); + $stateMock->expects($this->once())->method('getStatus')->will($this->returnValue('idle')); + $stateMock->expects($this->exactly(2))->method('save')->will($this->returnSelf()); + $this->stateFactoryMock->expects($this->once())->method('create')->will($this->returnValue($stateMock)); + + $this->viewMock->expects($this->once())->method('isEnabled')->will($this->returnValue(false)); + $this->viewMock->expects($this->never())->method('suspend'); + $this->viewMock->expects($this->once())->method('resume'); + + $actionMock = $this->createPartialMock( + \Magento\Framework\Indexer\ActionInterface::class, + ['executeFull', 'executeList', 'executeRow'] + ); + $actionMock->expects($this->once())->method('executeFull')->will( + $this->returnCallback( + function () { + throw new \Error('Test Engine Error'); + } + ) + ); + $this->actionFactoryMock->expects( + $this->once() + )->method( + 'create' + )->with( + 'Some\Class\Name' + )->will( + $this->returnValue($actionMock) + ); + + $this->model->reindexAll(); + } + protected function getIndexerData() { return [ From 6d4f36db79a9bee553b4acfe8c0820b5c046e6af Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:08 -0600 Subject: [PATCH 04/10] :arrow_double_up: Forwardport of magento/magento2#11240 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11240.patch (created by @leptoquark1) based on commit(s): 1. 16a8050e1252a943a80cf111b8392102135df617 2. 86032de8e54a0a8567dd8c503aa75ff38efbfa5c --- lib/internal/Magento/Framework/View/Model/Layout/Merge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php index ea8f74107954c..fe5c94ed21b30 100644 --- a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php +++ b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php @@ -811,7 +811,7 @@ private function getXmlErrors($libXmlErrors) protected function _getPhysicalTheme(\Magento\Framework\View\Design\ThemeInterface $theme) { $result = $theme; - while ($result->getId() && !$result->isPhysical()) { + while ($result !== null && $result->getId() && !$result->isPhysical()) { $result = $result->getParentTheme(); } if (!$result) { From 2e83a36fbf3201bdaf6612dcfce08125687f0e28 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:15 -0600 Subject: [PATCH 05/10] :arrow_double_up: Forwardport of magento/magento2#11342 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11342.patch (created by @denisristic) based on commit(s): 1. 6dfb610d611f6b22770f0f738951bdb89ca73734 2. f77dadbd3ad92610515b7fecd22f6217bb708df5 3. fc4723441c7652917201cac2b4411639bf2acd76 4. 9d593a4dbd55d6bd0343c3587c1b9bc3e1470d5e 5. 79693c8800f61780bcd44cf3fbbee92615f70514 Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#11310: Method "getChildren" sort ordering (reported by @EliasKotlyar) --- app/code/Magento/Catalog/Model/Category.php | 7 +++++-- .../Magento/Catalog/Model/ResourceModel/Category/Flat.php | 6 +++++- .../testsuite/Magento/Catalog/Model/CategoryTreeTest.php | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index c4d6742a02dd3..ff840635e4c70 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -780,11 +780,14 @@ public function getAllChildren($asArray = false) /** * Retrieve children ids comma separated * + * @param boolean $recursive + * @param boolean $isActive + * @param boolean $sortByPosition * @return string */ - public function getChildren() + public function getChildren($recursive = false, $isActive = true, $sortByPosition = false) { - return implode(',', $this->getResource()->getChildren($this, false)); + return implode(',', $this->getResource()->getChildren($this, $recursive, $isActive, $sortByPosition)); } /** diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php b/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php index d7f8bd9d789a2..01e4b072b0367 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php @@ -602,9 +602,10 @@ public function isInRootCategoryList($category) * @param \Magento\Catalog\Model\Category $category * @param bool $recursive * @param bool $isActive + * @param bool $sortByPosition * @return array */ - public function getChildren($category, $recursive = true, $isActive = true) + public function getChildren($category, $recursive = true, $isActive = true, $sortByPosition = false) { $select = $this->getConnection()->select()->from( $this->getMainStoreTable($category->getStoreId()), @@ -619,6 +620,9 @@ public function getChildren($category, $recursive = true, $isActive = true) if ($isActive) { $select->where('is_active = ?', '1'); } + if ($sortByPosition) { + $select->order('position ASC'); + } $_categories = $this->getConnection()->fetchAll($select); $categoriesIds = []; foreach ($_categories as $_category) { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php index 5e9244367bb13..8eeba1230f8b1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php @@ -128,6 +128,14 @@ public function testGetChildren() $this->assertEquals(array_diff([4, 13], explode(',', $this->_model->getChildren())), []); } + public function testGetChildrenSorted() + { + $this->_model->load(2); + $unsorted = explode(',', $this->_model->getChildren()); + sort($unsorted); + $this->assertEquals(array_diff($unsorted, explode(',', $this->_model->getChildren(true, true, true))), []); + } + public function testGetPathInStore() { $this->_model->load(5); From 23b4aa11f5a4a0b6bfe76cd1e812d36d88ed4d83 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:22 -0600 Subject: [PATCH 06/10] :arrow_double_up: Forwardport of magento/magento2#11493 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11493.patch (created by @JeroenVanLeusden) based on commit(s): 1. 221c593768ef67158740d143ceb55ef8b7f75436 --- app/code/Magento/Checkout/i18n/en_US.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Checkout/i18n/en_US.csv b/app/code/Magento/Checkout/i18n/en_US.csv index 69ec68a2cd579..8d297c4060abd 100644 --- a/app/code/Magento/Checkout/i18n/en_US.csv +++ b/app/code/Magento/Checkout/i18n/en_US.csv @@ -176,3 +176,4 @@ Payment,Payment "Not yet calculated","Not yet calculated" "We received your order!","We received your order!" "Thank you for your purchase!","Thank you for your purchase!" +"optional", "optional" From b50bfa811876af007426b734019fd149def63bba Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:30 -0600 Subject: [PATCH 07/10] :arrow_double_up: Forwardport of magento/magento2#11430 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11430.patch (created by @slackerzz) based on commit(s): 1. 354800097cfb6909aacaa98d8b8df3dfec4f8f35 Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#10941: Responsive Design Issue on Mobile with Magento 2.1.9 (reported by @rishabhchd19) --- .../luma/Magento_Catalog/web/css/source/module/_toolbar.less | 1 - 1 file changed, 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_toolbar.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_toolbar.less index 5c51938b23422..580abf264cadc 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_toolbar.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module/_toolbar.less @@ -44,7 +44,6 @@ line-height: @toolbar-mode-icon-font-size + 2; margin: 0; padding: 7px 0; - position: absolute; text-align: left; top: 0; vertical-align: middle; From 04cd60da14a87727768165942c23fc1403016e41 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:37 -0600 Subject: [PATCH 08/10] :arrow_double_up: Forwardport of magento/magento2#11199 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11199.patch (created by @osrecio) based on commit(s): 1. 41410ac66c1391ca0adb565e78cc32c71b872e9e Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#11176: Configured table prefix is not recognized in CLI admin:user:create (reported by @crtl) --- setup/src/Magento/Setup/Model/Installer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index 4a9bfd9063656..60cf85efc40ca 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -1010,6 +1010,7 @@ private function installOrderIncrementPrefix($orderIncrementPrefix) public function installAdminUser($data) { $this->assertDbConfigExists(); + $data += ['db-prefix' => $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_PREFIX)]; $setup = $this->setupFactory->create($this->context->getResources()); $adminAccount = $this->adminAccountFactory->create($setup->getConnection(), (array)$data); $adminAccount->save(); From 75d5a0522e8a18c2f403ea284d62e445e3d6ddc2 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:44 -0600 Subject: [PATCH 09/10] :arrow_double_up: Forwardport of magento/magento2#11299 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11299.patch (created by @lano-vargas) based on commit(s): 1. 17d37b2e362a75b69634ba9030ad37ef410713ab Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#11275: Call to a member function addCrumb() (reported by @lano-vargas) --- app/code/Magento/Sales/Helper/Guest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index a80be58bc003e..dd8845008d79e 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -178,6 +178,9 @@ public function loadValidOrder(App\RequestInterface $request) public function getBreadcrumbs(\Magento\Framework\View\Result\Page $resultPage) { $breadcrumbs = $resultPage->getLayout()->getBlock('breadcrumbs'); + if (!$breadcrumbs) { + return; + } $breadcrumbs->addCrumb( 'home', [ From 5e02b15fcbe310cd13e385d0ae7a3e6017b56497 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:54:51 -0600 Subject: [PATCH 10/10] :arrow_double_up: Forwardport of magento/magento2#11495 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11495.patch (created by @diazwatson) based on commit(s): 1. 84b0872d076bcb310f1febb550fb08addcac75ad Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#9783: Multiple parameters in widget.xml not allowed (reported by @milansimek) --- .../Magento/Widget/Model/Config/Converter.php | 23 ++++++++++++++----- app/code/Magento/Widget/etc/widget.xsd | 4 ++-- app/code/Magento/Widget/etc/widget_file.xsd | 4 ++-- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Widget/Model/Config/Converter.php b/app/code/Magento/Widget/Model/Config/Converter.php index 010c46da56950..40718a5a5db9c 100644 --- a/app/code/Magento/Widget/Model/Config/Converter.php +++ b/app/code/Magento/Widget/Model/Config/Converter.php @@ -222,7 +222,7 @@ protected function _convertDepends($source) { $depends = []; foreach ($source->childNodes as $childNode) { - if ($childNode->nodeName == '#text') { + if ($childNode->nodeName === '#text') { continue; } if ($childNode->nodeName !== 'parameter') { @@ -231,12 +231,23 @@ protected function _convertDepends($source) ); } $parameterAttributes = $childNode->attributes; - $depends[$parameterAttributes->getNamedItem( - 'name' - )->nodeValue] = [ - 'value' => $parameterAttributes->getNamedItem('value')->nodeValue, - ]; + $dependencyName = $parameterAttributes->getNamedItem('name')->nodeValue; + $dependencyValue = $parameterAttributes->getNamedItem('value')->nodeValue; + + if (!isset($depends[$dependencyName])) { + $depends[$dependencyName] = [ + 'value' => $dependencyValue, + ]; + + continue; + } else if (!isset($depends[$dependencyName]['values'])) { + $depends[$dependencyName]['values'] = [$depends[$dependencyName]['value']]; + unset($depends[$dependencyName]['value']); + } + + $depends[$dependencyName]['values'][] = $dependencyValue; } + return $depends; } diff --git a/app/code/Magento/Widget/etc/widget.xsd b/app/code/Magento/Widget/etc/widget.xsd index caaeec8ac4b84..70c9ec8e3514f 100644 --- a/app/code/Magento/Widget/etc/widget.xsd +++ b/app/code/Magento/Widget/etc/widget.xsd @@ -212,8 +212,8 @@ List of parameters this parameter depends on. - + - + diff --git a/app/code/Magento/Widget/etc/widget_file.xsd b/app/code/Magento/Widget/etc/widget_file.xsd index 6ebf7a201212e..afdd506f3ba24 100644 --- a/app/code/Magento/Widget/etc/widget_file.xsd +++ b/app/code/Magento/Widget/etc/widget_file.xsd @@ -212,8 +212,8 @@ List of parameters this parameter depends on. - + - +