Skip to content

Commit

Permalink
21842 - do not cache absolute file paths
Browse files Browse the repository at this point in the history
Github issue: magento#21842

In customer and customer_address validation context the validator
factory no longer caches absolute file paths for the validation.xml
files (currently two file) as the file content is evaluated later
in the filesystem directly and the file paths may not be correct
in a multi server setup with shared cache (id_prefix)
  • Loading branch information
david-fuehr committed May 9, 2019
1 parent 6468260 commit 1db265d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/internal/Magento/Framework/Validator/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,7 @@ public function __construct(
protected function _initializeConfigList()
{
if (!$this->_configFiles) {
$this->_configFiles = $this->cache->load(self::CACHE_KEY);
if (!$this->_configFiles) {
$this->_configFiles = $this->moduleReader->getConfigurationFiles('validation.xml');
$this->cache->save(
$this->getSerializer()->serialize($this->_configFiles->toArray()),
self::CACHE_KEY
);
} else {
$filesArray = $this->getSerializer()->unserialize($this->_configFiles);
$this->_configFiles = $this->getFileIteratorFactory()->create(array_keys($filesArray));
}
$this->_configFiles = $this->moduleReader->getConfigurationFiles('validation.xml');
}
}

Expand Down

0 comments on commit 1db265d

Please sign in to comment.