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: #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)
david-fuehr committed Mar 19, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent eb989e2 commit 7d0d01e
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
@@ -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');
}
}

0 comments on commit 7d0d01e

Please sign in to comment.