eZ Community » Forums » eZ Platform » eZ Platform image embed output...
expandshrink

eZ Platform image embed output escaped on macOS / OS X

eZ Platform image embed output escaped on macOS / OS X

Friday 12 May 2017 10:37:16 am - 4 replies

When working on eZ Platform and content embeds I encountered an issue where content output templates I experienced an issue where output is escaped by Twig when outputting content. Most often you embed image objects, which leads to output like this:

 <!-- START EzPublishCoreBundle:FieldType/RichText/embed:content.html.twig -->
<div class=" ez-embed-type-image">
<!-- START EzPublishCoreBundle:default:content/embed_image.html.twig -->
<figure >
<img src="http://127.0.0.1:8000/var/site/st...-1-eng-GB/symfony_black_03.png" alt="" />
</figure>
<!-- STOP EzPublishCoreBundle:default:content/embed_image.html.twig -->
</div>
<!-- STOP EzPublishCoreBundle:FieldType/RichText/embed:content.html.twig -->

I noticed that this only happens on macOS / OS X and initially tried looking at settings. But Damien Pobel from the eZ Platform development team pointed to me that there is already a ticket for this: EZP-25966: Embeds in RichText are rendered as literal HTML in some setups

Modified on Friday 12 May 2017 10:38:12 am by Jani Tarvainen

Friday 12 May 2017 11:14:28 am

It seems that this is caused by a bug in the XSLT with certain libxml2/libxslt versions. There is a workaround for this issue in the ticket, but I wanted to fix the issue in my environment, not alter the eZ Platform code.

My PHP version was PHP 7.1.4  installed from the Brew packet management system, with the following libxslt versions:

libxslt Version => 1.1.28
libxslt compiled against libxml Version => 2.9.2
libexslt Version => 1.1.28

There is a work around tried to upgrade the libxml2 and libxslt libraries via Brew with the --build-from-source option and a few other ideas. I could have also looked into trying to downgrade libxml to an older version, but decided against it in case it would be more trouble than it's worth.

In the end I decided to uninstall the Brew version of PHP 7.1 and install the PHP package for macOS from LIIP. With this version the content embedding works fine, so this is what I would recommend as a workaround for now.

For those who are curious, the libxslt details for the LIIP PHP 7.1 build is:

libxslt Version => 1.1.28
libxslt compiled against libxml Version => 2.9.0
libexslt Version => 1.1.28

Friday 12 May 2017 11:39:50 am

Thanks for sharing knowledge here instead of destroying it in one of Slack's Channels.

Friday 12 May 2017 11:54:23 am

Related?

From 2.9.3 change log: "Fix parsing short unclosed comment uninitialized access"

https://mail.gnome.org/archives/commits-list/2015-October/msg07949.html

Friday 12 May 2017 3:34:24 pm

So it seems it is an error that was introduced in a version of libxml newer than 2.9.0? That might explain why I only have this problem since I upgraded to macOS 10.12 (skipped some Versions, I think I was on 10.9 before) and reinstalled everything from scratch.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from