IBX-10425: Translated string is returned as XML#29
Conversation
7945846 to
d3ec14a
Compare
|
…n-a-translated-string # Conflicts: # phpstan.neon
57030ba to
0d8cd24
Compare
|
There was a problem hiding this comment.
You should add unit coverage for EncoderHelper::clearCDATAInTextField() to prove it strips CDATA on non‑RichText fields while preserving RichText, and an integration-style Encoder test that asserts the final XML contains plain text for regular fields and the placeholder tags for RichText. This guards the new logic and prevents regressions.
85bf0c6 to
bfd0999
Compare
bfd0999 to
3808037
Compare
| use Ibexa\FieldTypeRichText\FieldType\RichText\Value as RichTextValue; | ||
| use RuntimeException; | ||
|
|
||
| final class EncoderHelper |
There was a problem hiding this comment.
I know it is a matter of preference, but I really don't like use name Helper for cases like this.
IMO this could be TextFieldCdataCleaner, TextFieldDataSanitizer, TextFieldValueSanitizer, XmlTextFieldSanitizer
| if ($type !== RichTextValue::class) { | ||
| $newText = $dom->createTextNode($textNode->data); | ||
| $parent->replaceChild($newText, $textNode); | ||
| } |
There was a problem hiding this comment.
IMO this is not SOLID and shouldn't be like this. This bundle will be abandoned in next few weeks so it is up to you if you have a time and resource to provide some more flexible solution.
There was a problem hiding this comment.
I changed the name and changed the function to smaller functions
|
juskora
left a comment
There was a problem hiding this comment.
QA Approved on Ibexa DXP Commerce 4.6-dev.
|
@mateuszdebinski you can merge up changes. Important note: the upmerge workflow has changed, the flow is now 4.6 -> 5.0 -> 6.0. Please make sure that you don't push |





Description:
For QA:
Documentation: