From 1e1ebd3a9ee69038841f41ebe8771b6a1fa700d6 Mon Sep 17 00:00:00 2001 From: Burlacu Vasilii Date: Thu, 12 Mar 2020 13:17:37 +0200 Subject: [PATCH 1/3] Fix: ORDER BY has two similar conditions in the SQL query --- app/code/Magento/Catalog/Block/Product/ListProduct.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index 144cb682e2d22..f1adc1d924836 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -475,8 +475,6 @@ private function initializeProductCollection() $layer->setCurrentCategory($origCategory); } - $this->addToolbarBlock($collection); - $this->_eventManager->dispatch( 'catalog_block_product_list_collection', ['collection' => $collection] From df35ddac0dacf30be6547a7cbad113c3ed6ed3fc Mon Sep 17 00:00:00 2001 From: Burlacu Vasilii Date: Wed, 18 Mar 2020 16:04:54 +0200 Subject: [PATCH 2/3] Fix failed unit test --- .../Catalog/Test/Unit/Block/Product/ListProductTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php index fe07f69e8046f..4653934311938 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php @@ -187,10 +187,6 @@ public function testGetIdentities() ->method('getProductCollection') ->will($this->returnValue($this->prodCollectionMock)); - $this->layoutMock->expects($this->once()) - ->method('getBlock') - ->will($this->returnValue($this->toolbarMock)); - $this->assertEquals( [$categoryTag, $productTag], $this->block->getIdentities() From b8163347447bc8ee6636440c1d4ab522cc950af2 Mon Sep 17 00:00:00 2001 From: Eduard Chitoraga Date: Thu, 19 Mar 2020 08:52:34 +0200 Subject: [PATCH 3/3] Fixing static test --- app/code/Magento/Catalog/Block/Product/ListProduct.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index f1adc1d924836..59f5cc1b53b26 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -355,6 +355,7 @@ public function getIdentities() } foreach ($this->_getProductCollection() as $item) { + // phpcs:ignore Magento2.Performance.ForeachArrayMerge $identities = array_merge($identities, $item->getIdentities()); }