getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

Home Page:https://getgrav.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1.7.31 breaks displaying an image picked in a mediapicker field

sebastianbaumann opened this issue · comments

I'm trying to display an image similar to this twig recipe from the docs, which worked before updating to 1.7.31.
After the update the same method results in a Twig runtime error.

https://learn.getgrav.org/17/cookbook/twig-recipes#displaying-an-image-picke

{% set image_parts = pathinfo(site.rating.image) %}
{% set image_basename = image_parts.basename %}
{% set image_page = page.find('/media') %}

{{ image_page.media[image_basename].html()|raw }}`

Results in:

Twig \ Error \ RuntimeError An exception has been thrown during the rendering of a template ("simplexml_load_string(): Entity: line 16: parser error : Attribute class redefined").

Sorry guys! False alarm. Had a broken svg image inside my media folder, which was the cause of this problem.