-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Backport] 21842: don't cache absolute file paths in validator factory #22805
[Backport] 21842: don't cache absolute file paths in validator factory #22805
Conversation
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)
- adapt unit test
- refactoring of static method use should be in a separate pull request
Hi @david-fuehr. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @osrecio, thank you for the review. |
✔️ QA passed |
Hi @david-fuehr, thank you for your contribution! |
Original Pull Request
#21856
Description
This issue comes from
Magento\Framework\Validator\Factory::_initializeConfigList
where absolute file paths are cached. The actual file content is evaluated using the local file system.The method is used in
\Magento\Customer\Model\ResourceModel\Address::_validate
,\Magento\Quote\Model\CustomerManagement::validateAddresses
and\Magento\Customer\Model\ResourceModel\Customer::_validate
and thus an error (The "/<abs_instance_path>/app/code/Magento/Eav/etc/validation.xml" file doesn't exist.) occurs whenever acustomer
, acustomer_address
or quote for a registered customer is saved.Fixed Issues
Manual testing scenarios
most realistic scenario
/var/www/backend/release/2019-02-28
)/var/www/frontend/release/2019-02-28
)/var/www/frontend/release/2019-03-01
- autospawned)id_prefix
in cache section ofenv.php
)customer
orcustomer_address
on the backend node (may be a cron job or similar)1.expected: The success page is being shown
simplified repro steps
id_prefix
inenv.php
is definedContribution checklist