Skip to content
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

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

Open
wants to merge 2 commits into
base: 1.7
Choose a base branch
from

Conversation

vidarl
Copy link
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
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
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

// 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
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