Skip to content

EZP-30513: eZXMLText Migration: link tags containing embed-inline + other elements fails#110

Open
vidarl wants to merge 2 commits into1.7from
1.7_fix_ezp30513
Open

EZP-30513: eZXMLText Migration: link tags containing embed-inline + other elements fails#110
vidarl wants to merge 2 commits into1.7from
1.7_fix_ezp30513

Conversation

@vidarl
Copy link
Copy Markdown
Member

@vidarl vidarl commented Oct 16, 2019

Question Answer
JIRA issue EZP-30513
Type Bug
Target version 1.7
BC breaks no
Doc needed no

TODO:

  • Implement feature / fix a bug.
  • Implement tests + specs and passing ($ composer test)
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@vidarl vidarl changed the base branch from 1.9 to 1.7 October 16, 2019 13:22
Copy link
Copy Markdown
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ;)

@vidarl
Copy link
Copy Markdown
Member Author

vidarl commented Oct 17, 2019

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 :

php vendor/bin/phpunit --filter RichTextTest::testConvert#16
php vendor/bin/phpunit --filter RichTextTest::testConvert#17

// 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]';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants