Twig Error Runtime
opened this issue · comments
You get the following error page upon install or if you try to access the plugin through the new Admin Panel.
An exception has been thrown during the rendering of a template ("Array to string conversion") in "forms/fields/toggle/toggle.html.twig" at line 31. (see attachment below)
I've used a clean GRAV site with no adjustment at all.
Suggestions?
Hello @umbergerba I have no idea at all. I'm not using any forms. And unfortunately I neither can reproduce your issue or see from the error page, that this is due to this plugin here. Can you attach the full error page here (at least the left side or something that identifies, that it is really coming from the MediaEmbed plugin)? And if so, I guess this is an Adim plugin issue, since it reads the plugins blueprints.yaml
and process the forms. I really can't do anything, here...
Maybe someone other can confirm this issue or help me sorting out the bug.
I get the same error on two different GRAV sites. Here is the left-hand side of the error page ...
- Twig_Error_Runtime
…/vendor/twig/twig/lib/Twig/Template.php171 - Whoops\Exception\ErrorException
…/cache/twig/9/3/936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe.php107 - Whoops\Run handleError
…/cache/twig/9/3/936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe.php107 - __TwigTemplate_936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe block_input
…/vendor/twig/twig/lib/Twig/Template.php156 - Twig_Template displayBlock
…/cache/twig/b/7/b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php177 - __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 block_group
…/vendor/twig/twig/lib/Twig/Template.php156 - Twig_Template displayBlock
…/cache/twig/b/7/b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php121 - __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 block_contents
…/vendor/twig/twig/lib/Twig/Template.php156 - Twig_Template displayBlock
…/cache/twig/b/7/b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php48 - __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 block_field
…/vendor/twig/twig/lib/Twig/Template.php156 - Twig_Template displayBlock
…/cache/twig/b/7/b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php35 - __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/9/3/936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe.php45 - __TwigTemplate_936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/c/d/cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208.php74 - __TwigTemplate_cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208 doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/c/d/cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208.php74 - __TwigTemplate_cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208 doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/6/d/6d2099856c084c49060b74f7ace9ef2c737023acd0aa7b6451ecd13e9a27a461.php60 - __TwigTemplate_6d2099856c084c49060b74f7ace9ef2c737023acd0aa7b6451ecd13e9a27a461 doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/9/3/934816f494650954d72df4320acf423a2c343a2920cdf5b041e8e16cc38301ca.php96 - __TwigTemplate_934816f494650954d72df4320acf423a2c343a2920cdf5b041e8e16cc38301ca doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/9/6/964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1.php136 - __TwigTemplate_964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1 block_content
…/vendor/twig/twig/lib/Twig/Template.php156 - Twig_Template displayBlock
…/cache/twig/a/9/a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1.php271 - __TwigTemplate_a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1 block_page
…/vendor/twig/twig/lib/Twig/Template.php156 - Twig_Template displayBlock
…/cache/twig/a/9/a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1.php40 - __TwigTemplate_a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1 doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/cache/twig/9/6/964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1.php44 - __TwigTemplate_964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1 doDisplay
…/vendor/twig/twig/lib/Twig/Template.php333 - Twig_Template displayWithErrorHandling
…/vendor/twig/twig/lib/Twig/Template.php307 - Twig_Template display
…/vendor/twig/twig/lib/Twig/Template.php318 - Twig_Template render
…/vendor/twig/twig/lib/Twig/Environment.php293 - Twig_Environment render
…/system/src/Grav/Common/Twig/Twig.php324 - Grav\Common\Twig\Twig processSite
…/system/src/Grav/Common/Grav.php143 - Grav\Common\Grav Grav\Common{closure}
…/vendor/pimple/pimple/src/Pimple/Container.php112 - Pimple\Container offsetGet
…/system/src/Grav/Common/Grav.php231 - Grav\Common\Grav process
…/index.php31
Hope that helps ... let me know if there is anymore more you might need.
Brian U.
Hi @umbergerba ,
well from this error stack I unfortunately can't locate the bug. I was hoping that at least something is poitning to the MediaEmbed plugin... Well, you may try to change one variable in the hope that helps. To do this, can you change blueprints.yaml (L15) to
validation: loose
and see whether this solves your problem?
No change.
Ok, I guess this is really an Admin panel issue. But before I'm completely sure, can you cross-check the following change? I assume you have Admin panel v0.3.0 installed. If not please update it to this release. Then navigate to the file themes/grav/templates/forms/fields/toggle/toggle.html.twig
and at line 31 change it to
{% if key == value %}checked="checked" {% endif %}
Please let me know, whether this helps.
Yes, that seems to have worked. I now have access to the plugin settings under Admin Panel. It also seems to install correctly too.
Great! I will open an issue on the Grav Admin plugin tracker as soon as I'm sure this issue persists in the latest version. Thus, I will close this now. Feel free to open it again.
Happening for me. I believe it is due to the media embed plugin
@sheldonkotyk Can you clarify your thought? Initially this issue was due to a bug in the Grav Admin Plugin, how blueprints are rendered. To be honest this plugin is quite old and blueprint support for admin panel is very limited (since I don't know how to wrap it up in a simple way). If you have any questions, I'm happy to hear 😄.
OK, I wasn't experiencing the issue until I installed the media embed plugin. I've since disabled it as I was having other issues that made it more difficult than just embedding an iframe.
If you want to debug with me I can try again or we can leave it.