eZ Community » Forums » eZ Publish 5 Platform » image is not showing in preview article
expandshrink

image is not showing in preview article

image is not showing in preview article

Thursday 05 November 2015 3:11:11 pm

When we click on "Preview" button  to see the preview of article before publish it, the image is not showing in preview. We are trying to do that with default article class and image attribute.

We have checked the ez kernel code and we noted the problem is: loadBinaryFile method in ToleranteIOService.php file always loads the image file with publish prefix instead of draft prefix (VersionedImage in image.ini).

We have fixed that by hacking the loadBinaryFile method. See our code below:

 try{     $spiBinaryFile = $this->metadataHandler->load( $this->getPrefixedUri( $binaryFileId ) ); }    catch ( BinaryFileNotFoundException $e ){     try    {        $this->setPrefix('images-versioned');        $spiBinaryFile = $this->metadataHandler->load( $this->getPrefixedUri( $binaryFileId ) );    }    catch (BinaryFileNotFoundException $e )    {         $this->logMissingFile( $binaryFileId ); return $this->createMissingBinaryFile( $binaryFileId ); }}

Is there another way to fix that?

Modified on Thursday 05 November 2015 3:35:07 pm by Bruno Zanetti

No reply yet!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from