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

Image is not displayed when previewing unpublished content




      When previewing a content from back-office, if this content has an image attribute and has not yet been published, the image is not displayed.

      Digging into the kernel, I found out that the loadBinaryFile method from vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/Image/IO/Legacy.php is never called with an internal path (i.e full path with 'images-versioned' in it), so the method can never load the binary file from the images-versioned folder.

      The loadBinaryFileByUri method has recently been fixed to address the same issue (See https://jira.ez.no/browse/EZP-27551), but this method is never called when previewing a content with an image attribute...

      I also checked the $imageValue object properties in vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Imagine/AliasGenerator.php: the uri property has a /images path instead of /images-versioned.

      Added by the Support Team:
      There already was an attempt to fix this issue in EZP-27123 (comments might shed some light on the issue).
      EZP-27551 covers a fatal error while trying to preview draft with an image (and it fixes the fatal error only). This ticket is about not showing preview while viewing the draft. Applying fix from EZP-27551 will get rid of the fatal error, but the image is still not visible.
      This issue doesn't happen in eZ Platform (the image is displayed correctly in the preview).

      Steps to reproduce

      1. Create new eZ Publish 5.4.10 installation with the patch from EZP-27551 applied.
      2. In the legacy admin create or edit a content containing an attribute of type "image".
      3. Upload an image file.
      4. Without publishing the content, press "Preview" on the left panel. The image won't be displayed in the preview.


          Issue Links



              • Assignee:
                supasteevo Steven Bressey
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created:

                  Time Tracking

                  Original Estimate - Not Specified
                  Not Specified
                  Remaining Estimate - 0 minutes
                  Time Spent - 3 days, 5 hours, 15 minutes
                  3d 5h 15m