EZP-30513: eZXMLText Migration: link tags containing embed-inline + other elements fails#110
EZP-30513: eZXMLText Migration: link tags containing embed-inline + other elements fails#110
Conversation
…ther elements fails
alongosz
left a comment
There was a problem hiding this comment.
RichText DocBook-wise it's ok, but...
We need to test it, because I have feeling that OE will crash (as mentioned in JIRA).
I'm not up to speed with the migration command. Do you have a recommendation how I could quickly test that migration? Preferably w/o creating Legacy instance and using it with Legacy Bridge ;)
|
What you want to test is how eZ Platform/OE deals with the that DocBook, right?. Then I would just insert the docbook markup provided in tests into existing content objects in a ezplatform db using mysql client ( change the IDs to valid ones of course ). If you want to test the migration itself, without legacy, just run the provided tests : |
| // Select embeds that are linked ( but only where embed is the only child of the link ) | ||
| // After Expanding converter such links will contain only single embed element | ||
| $xpathExpression = '//embed[parent::link]|//embed-inline[parent::link]'; | ||
| $xpathExpression = '//embed[parent::link][count(preceding-sibling::*)+count(following-sibling::*)=0]|//embed-inline[parent::link][count(preceding-sibling::*)+count(following-sibling::*)=0]'; |
There was a problem hiding this comment.
After giving it more thought, I'm not convinced that we should distinguish here a case where there's only one embed. It should be handled uniformly:
<para>Link:
<link xlink:href="ezlocation://333" xlink:show="none">Foo
<ezembedinline xlink:href="ezcontent://444" view="embed-inline">
<ezconfig>
<ezvalue key="size">original</ezvalue>
</ezconfig>
</ezembedinline>
bar
<ezembedinline xlink:href="ezcontent://445" view="embed-inline">
<ezconfig>
<ezvalue key="size">original</ezvalue>
</ezconfig>
</ezembedinline>
2
</link>
</para> and
<para>Link:
<link xlink:href="ezlocation://333" xlink:show="none">Foo
<ezembedinline xlink:href="ezcontent://444" view="embed-inline">
<ezconfig>
<ezvalue key="size">original</ezvalue>
</ezconfig>
</ezembedinline>
bar
</link>
</para>The only reason we would make a distinction here would be if UI was different for both cases. However I cannot imagine UI which would take advantage of link inside of embed-inline.
TODO:
$ composer test)$ composer fix-cs).