Skip to content

Commit

Permalink
Merge pull request #541 from magento-performance/ACPT-1263
Browse files Browse the repository at this point in the history
ACPT-1263: Fix Catalog failures on app server
  • Loading branch information
andimov authored May 24, 2023
2 parents b2903a5 + b6996b0 commit 8c8cb94
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
16 changes: 13 additions & 3 deletions app/code/Magento/Catalog/Model/Layer/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@

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';
public const CATALOG_LAYER_CATEGORY = 'category';
public const CATALOG_LAYER_SEARCH = 'search';

/**
* Catalog view layer models list
Expand Down Expand Up @@ -79,4 +81,12 @@ public function get()
}
return $this->layer;
}

/**
* @inheritDoc
*/
public function _resetState(): void
{
$this->layer = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ public function testValidateAggregateAttributeOptionsInLabelLocaleTranslationFor
}
}

$this->assertEquals($priceAttributeOptionLabel, 'Preisansicht');
$this->assertEquals('Preisansicht', $priceAttributeOptionLabel);
}
}
11 changes: 1 addition & 10 deletions lib/internal/Magento/Framework/App/Area.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
namespace Magento\Framework\App;

use Magento\Framework\ObjectManager\ConfigLoaderInterface;
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;

/**
* Application area model
*
* @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';
Expand Down Expand Up @@ -261,12 +260,4 @@ protected function _initDesign()
$this->_getDesign()->setArea($this->_code)->setDefaultDesignTheme();
return $this;
}

/**
* @inheritDoc
*/
public function _resetState(): void
{
$this->_loadedParts = [];
}
}
12 changes: 11 additions & 1 deletion lib/internal/Magento/Framework/App/AreaList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,4 +129,12 @@ public function getArea($code)
}
return $this->_areaInstances[$code];
}

/**
* @inheritDoc
*/
public function _resetState(): void
{
$this->_areaInstances = [];
}
}
1 change: 1 addition & 0 deletions lib/internal/Magento/Framework/Translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,5 +609,6 @@ public function _resetState(): void
{
$this->_config = [];
$this->_data = [];
$this->_localeCode = null;
}
}

0 comments on commit 8c8cb94

Please sign in to comment.