Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-32345

Converting the XMLText field to RichText can result in missing links from embeds

    XMLWordPrintable

Details

    Description

      When there is a link placed on the Embed element inside the XMLblock field, conversion to the RichText can cause this link to be missing when content is opened for edition.

      Steps to reproduce
      1. Clean installation of eZ Platform 2.5 or Ibexa DXP 3.2/3.3
      2. Install and enable https://github.com/ezsystems/ezplatform-xmltext-fieldtype
      3. Login into the back office as admin to create and publish a new Image content Image.
      4. Create and publish a new Folder Test. Inside the "short description" field create a link to the https://ibexa.co/
      5. Create a new Content Type XML Test containing XML block field called body.
      6. Create and Publish a new XML Test Content, with body set to:

       <?xml version="1.0" encoding="UTF-8"?>
      <section xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/" xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/">
         <paragraph>
            <link url_id="30">
               <embed view="embed" size="medium" align="left" object_id="55" custom:offset="0" custom:limit="48" custom:zoomlevel="" />
            </link>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eu orci ut quam porta congue. Nulla ultrices tincidunt eros, in rutrum ex. Vestibulum a bibendum justo, non congue libero. In placerat sem ac odio iaculis, id ornare neque eleifend. Ut malesuada non augue sit amet tempus. Etiam in lobortis est. Phasellus eget cursus felis. Nulla risus enim, sagittis sit amet hendrerit ut, blandit quis turpis. Nullam mattis ligula sed sapien bibendum vestibulum. Ut faucibus, sapien ac blandit dictum, neque purus pellentesque velit, et posuere risus felis sit amet enim. Morbi fringilla ex eget ornare faucibus. Nam mollis pulvinar metus, et vestibulum tortor pulvinar nec. Maecenas finibus diam a pharetra fringilla.
         </paragraph>
      </section>
      

      Please note that you might change url_id="30" and object_id="55" to match your installation.
      7. Execute the Command converting XML block to RichText field.

      php bin/console ezxmltext:convert-to-richtext
      

      and clear the cache.
      8. Open again the Content created in step 6. Click on the "Edit" button.

      Result
      The embedded image won't show an indication that there is a link attached to it and when clicked on to edit link, the "Link to" field will be empty.

      Expected result
      The embedded image will show link indication and when edited, the "Link to" field will display the link set from before the conversion.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mateusz.bieniek@ibexa.co Mateusz Bieniek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: