-
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
Add support for multiple space-separated CDATA sections in Magento\Framework\Xml\Parser #26822
Conversation
Hi @fnogatz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@magento create issue |
4330070
to
ca07823
Compare
@magento run all tests |
@magento run Unit tests, Static Tests |
@magento run Unit Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fnogatz,
Thank you for updating your PR, now it looks really good.
The only thing left - could you please also fix failing static tests? I know that this failure not caused by your changes, but still need to have not failing static tests for changed files.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔ Approved.
Failing tests looks not related to changes form this PR.
Hi @ihor-sviziev, thank you for the review. |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fnogatz . During testing PR changes I tried to add multiple CDATA sections into label and there are results:
Case 1: add multiple CDATA into comment
node
Result:
❌ No comment is shown under field
Case 2: add multiple CDATA into label
node
Result:
❌ Exception error "Notice: Array to string conversion in /var/www/html/magento2dev/lib/internal/Magento/Framework/Phrase.php on line 72
in log
Could you clarify in what cases multiple CDATA is used?
Hi @engcom-Delta. Thank you for having a look into it! We use the XML parser class provided by Magento in However, I tried to reproduce the issue on the Magento backend as you did by modifying Magento's XML files. To be honest, after two hours I have no clue why it behaves differently. Here's my Case 3:
I have no idea, how the full description can be shown in the Magento backend without this PR, whereas manually loading the XML file results in an incomplete string at the same time -- which makes it hard for me to debug :/ |
@engcom-Charlie @engcom-Delta @engcom-Bravo could you help with that? |
@fnogatz you can see merged
|
Hi, @fnogatz could you please provide steps to reproduce the issue? |
Hi @fnogatz, |
@fnogatz I am closing this PR now due to inactivity. |
Hi @fnogatz, thank you for your contribution! |
Description (*)
Our XML files sometimes contain multiple CDATA sections per node. The XML parser class provided by Magento in
/lib/internal/Magento/Framework/Xml/Parser.php
already supports consecutive CDATA sections like<![CDATA[One]]><![CDATA[Two]]><![CDATA[Three]]>
, which is correctly parsed asOneTwoThree
. However this returns wrong results for empty text nodes in-between, like for<![CDATA[One]]> <![CDATA[Two]]> <![CDATA[Three]]>
. This pull request adds the support and a related unit test.Related Pull Requests
The
switch
statement has been added in #681.Fixed Issues (if relevant)
No separate issue created.
Manual testing scenarios (*)
Unit tests added as part of this pull request.
You can use the current 2.3.4 version for testing. The file in question
/lib/internal/Magento/Framework/Xml/Parser.php
is unchanged since August 2017.Questions or comments
Contribution checklist (*)
Resolved issues: