Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-136280

Adaptive media variants are not generated for Web Content images

    Details

      Description

      Issue
      Adaptive media variants are not generated for Web Content images after editing the image. Although the <picture> element exists on the first publish, after editing and publishing the same content, we will only see the <img> element and the adaptive media variants are stripped from the Web Content.

      Note: This is inconsistent with behavior observed in Blogs. In Blogs, we can see that the <img> element includes a "data-fileentryid" which corresponds with any adaptive media versions of the image.

      Steps to Reproduce
      1. Install Liferay DXP 7.3 SP1 + hotfix 1796
      2. Start Liferay
      3. Sign in to Liferay
      4. Publish a Basic Web Content:

      • Title: Test web content
      • Summary: Test
      • Description: Upload a large image (attached) - [^liferay-product-downloads.png]

      5. Open the home page
      6. Search for: test
      7. Click the search result
      8. Right-click on the image and click Inspect
      9. Assert that the image is rendered as a <picture> tag with the two adaptive media variants
      10. Edit the same Basic Web Content
      11. Click publish without any changes
      12. Open the home page
      13. Search for: test
      14. Click the search result
      15. Right-click on the image and click Inspect

      Actual Behavior
      The image is rendered as an <img> tag without the two adaptive media variants

      Expected Behavior
      The image is either (a) rendered as a <picture> tag with the two adaptive media variants, or (b) it is rendered as an <img> tag with the two adaptive media variants. For example, if you repeat these steps for Blogs widget, you will observe that the <img> tag has a "data-fileentryid" attribute which adaptive media uses to generate the variants. This attribute is no longer being added by the CKEditor for web content like it used to in previous versions.

      Reproduced in

      • Liferay DXP 7.3 + DXP-1 + hotfix 1796

      Different Behavior in

      • 7.3.X-private Commit: 566f8f3074157ce8d2ae9dde77db0acdd5fe7a61
        • After step 8, inspecting the element shows no adaptive variants present.
      • Master-private Commit: 9e5d15a395737bfccd112d7855cb9b2e8f33e39d
        • After step 8, inspecting the element shows no adaptive variants present.

        Attachments

          Activity

            People

            Assignee:
            yvonne.han Yvonne Han
            Reporter:
            to.trinh To To Trinh
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            To To Trinh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              18 weeks, 1 day ago

                Packages

                Version Package
                7.3.X
                7.4.13 DXP GA1
                7.4.3.4 CE GA4
                Master