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
- Create new eZ Publish 5.4.10 installation with the patch from
- In the legacy admin create or edit a content containing an attribute of type "image".
- Upload an image file.
- Without publishing the content, press "Preview" on the left panel. The image won't be displayed in the preview.