-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixes xsd schema to work with libxml 2.12 and higher. #38553
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
Conversation
Hi @hostep. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
Hi, Internal team has started to work on it Thanks. |
just a friendly wave to say this works as a fix on 2.4.6-p5 |
Thanks, this works for me too |
Looks like this got merged in |
The change was cherry-picked to 308e261 and merged to 2.4-develop branch, so we can close this PR |
Description (*)
The latest libxml2 library (2.12.*) contains more strict requirements for xsd schema files:
There is one xsd file in Magento which now fails these more stricter checks:
app/code/Magento/Elasticsearch/etc/esconfig.xsd
When using any Magento version with libxml2 version 2.12.* in developer mode, whenever an xml file with
esconfig.xsd
schema is being loaded, it will now fail with this error:This PR fixes this. It should be mostly backwards compatible. With the exception that it now always expect the
type
element to be in front of thedefault
element in thestemmer
section, but that matches how Magento's xml files are already setup:This PR fixes an additional problem - by splitting out the types for
stemmer
andstopwords_file
. Previously, there was no requirement ontype
element, even though the code that parses this xml file requires thetype
to exist. That's been fixed by no longer usingmixedDataType
for bothstemmer
andstopwords_file
elements, but splitting it out in 2 distinct types where the one forstemmer
now requires atype
element to exist.I've tested these changes with libxml2 versions 2.9.14 and 2.12.6 and both work correctly.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
test-xsd.php
file in the root of the magento project with this contents:php test-xsd.php
, expected is to see no errorsphp test-xsd.php
, expected is to see no errorsAlternative steps:
bin/magento indexer:reindex catalogsearch_fulltext
, expect to get no errorsQuestions or comments
I haven't found time or energy to add/update unit tests, if this is required, it would be appreciated if somebody could lend a hand.
Contribution checklist (*)