From 6be0c2b00659128e32e3d168ce4913869e2703e3 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 23 May 2023 16:00:59 -0500 Subject: [PATCH 1/3] ACPT-1263: Fix Catalog failures --- app/code/Magento/Catalog/Model/Layer/Resolver.php | 12 +++++++++++- .../PriceAttributeOptionsLabelTranslateTest.php | 2 +- lib/internal/Magento/Framework/App/Area.php | 11 +---------- lib/internal/Magento/Framework/App/AreaList.php | 12 +++++++++++- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Layer/Resolver.php b/app/code/Magento/Catalog/Model/Layer/Resolver.php index a4224aeafe7e0..af02538bcd436 100644 --- a/app/code/Magento/Catalog/Model/Layer/Resolver.php +++ b/app/code/Magento/Catalog/Model/Layer/Resolver.php @@ -9,12 +9,14 @@ namespace Magento\Catalog\Model\Layer; +use Magento\Framework\ObjectManager\ResetAfterRequestInterface; + /** * Layer Resolver * * @api */ -class Resolver +class Resolver implements ResetAfterRequestInterface { const CATALOG_LAYER_CATEGORY = 'category'; const CATALOG_LAYER_SEARCH = 'search'; @@ -79,4 +81,12 @@ public function get() } return $this->layer; } + + /** + * @inheritDoc + */ + public function _resetState(): void + { + $this->layer = null; + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php index 425643a37f308..52df934512756 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php @@ -201,6 +201,6 @@ public function testValidateAggregateAttributeOptionsInLabelLocaleTranslationFor } } - $this->assertEquals($priceAttributeOptionLabel, 'Preisansicht'); + $this->assertEquals( 'Preisansicht', $priceAttributeOptionLabel); } } diff --git a/lib/internal/Magento/Framework/App/Area.php b/lib/internal/Magento/Framework/App/Area.php index dcda864197f88..58a690a230b59 100644 --- a/lib/internal/Magento/Framework/App/Area.php +++ b/lib/internal/Magento/Framework/App/Area.php @@ -9,7 +9,6 @@ namespace Magento\Framework\App; use Magento\Framework\ObjectManager\ConfigLoaderInterface; -use Magento\Framework\ObjectManager\ResetAfterRequestInterface; /** * Application area model @@ -17,7 +16,7 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @api */ -class Area implements \Magento\Framework\App\AreaInterface, ResetAfterRequestInterface +class Area implements \Magento\Framework\App\AreaInterface { public const AREA_GLOBAL = 'global'; public const AREA_FRONTEND = 'frontend'; @@ -261,12 +260,4 @@ protected function _initDesign() $this->_getDesign()->setArea($this->_code)->setDefaultDesignTheme(); return $this; } - - /** - * @inheritDoc - */ - public function _resetState(): void - { - $this->_loadedParts = []; - } } diff --git a/lib/internal/Magento/Framework/App/AreaList.php b/lib/internal/Magento/Framework/App/AreaList.php index 8c3cc1d551916..c69bf42bdc06a 100644 --- a/lib/internal/Magento/Framework/App/AreaList.php +++ b/lib/internal/Magento/Framework/App/AreaList.php @@ -5,12 +5,14 @@ */ namespace Magento\Framework\App; +use Magento\Framework\ObjectManager\ResetAfterRequestInterface; + /** * Lists router area codes & processes resolves FrontEndNames to area codes * * @api */ -class AreaList +class AreaList implements ResetAfterRequestInterface { /** * @var array @@ -127,4 +129,12 @@ public function getArea($code) } return $this->_areaInstances[$code]; } + + /** + * @inheritDoc + */ + public function _resetState(): void + { + $this->_areaInstances = []; + } } From 1faf86de6f526bfc1de865303a6087f494481d6c Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 23 May 2023 22:50:54 -0500 Subject: [PATCH 2/3] ACPT-1263: Fix Catalog failures --- lib/internal/Magento/Framework/Translate.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Translate.php b/lib/internal/Magento/Framework/Translate.php index 3b8069c8ef2f1..7dc7622c2eed2 100644 --- a/lib/internal/Magento/Framework/Translate.php +++ b/lib/internal/Magento/Framework/Translate.php @@ -609,5 +609,6 @@ public function _resetState(): void { $this->_config = []; $this->_data = []; + $this->_localeCode = null; } } From b6996b0e09d0b9d966959579b672d73f527249f3 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 23 May 2023 22:52:42 -0500 Subject: [PATCH 3/3] ACPT-1263: Fix Catalog failures --- app/code/Magento/Catalog/Model/Layer/Resolver.php | 4 ++-- .../PriceAttributeOptionsLabelTranslateTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Layer/Resolver.php b/app/code/Magento/Catalog/Model/Layer/Resolver.php index af02538bcd436..b6ca16f1ac029 100644 --- a/app/code/Magento/Catalog/Model/Layer/Resolver.php +++ b/app/code/Magento/Catalog/Model/Layer/Resolver.php @@ -18,8 +18,8 @@ */ class Resolver implements ResetAfterRequestInterface { - const CATALOG_LAYER_CATEGORY = 'category'; - const CATALOG_LAYER_SEARCH = 'search'; + public const CATALOG_LAYER_CATEGORY = 'category'; + public const CATALOG_LAYER_SEARCH = 'search'; /** * Catalog view layer models list diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php index 52df934512756..643d2131bb995 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/PriceAttributeOptionsLabelTranslateTest.php @@ -201,6 +201,6 @@ public function testValidateAggregateAttributeOptionsInLabelLocaleTranslationFor } } - $this->assertEquals( 'Preisansicht', $priceAttributeOptionLabel); + $this->assertEquals('Preisansicht', $priceAttributeOptionLabel); } }