Sommerregen / grav-plugin-mediaembed

This plugin embeds several media sites (e.g. YouTube, Vimeo, Soundcloud) by only providing the URL to the medium.
Other
24 stars 8 forks source link

Twig Error Runtime #6

Closed ghost closed 8 years ago

ghost commented 8 years ago

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?

screen shot 2015-08-14 at 8 02 02 pm

Sommerregen commented 8 years ago

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.

ghost commented 8 years ago

I get the same error on two different GRAV sites. Here is the left-hand side of the error page ...

  1. Twig_Error_Runtime …/­vendor/­twig/­twig/­lib/­Twig/­Template.php171
  2. Whoops\Exception\ErrorException …/­cache/­twig/­9/­3/­936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe.php107
  3. Whoops\Run handleError …/­cache/­twig/­9/­3/­936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe.php107
  4. __TwigTemplate_936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe block_input …/­vendor/­twig/­twig/­lib/­Twig/­Template.php156
  5. Twig_Template displayBlock …/­cache/­twig/­b/­7/­b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php177
  6. __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 block_group …/­vendor/­twig/­twig/­lib/­Twig/­Template.php156
  7. Twig_Template displayBlock …/­cache/­twig/­b/­7/­b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php121
  8. __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 block_contents …/­vendor/­twig/­twig/­lib/­Twig/­Template.php156
  9. Twig_Template displayBlock …/­cache/­twig/­b/­7/­b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php48
  10. __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 block_field …/­vendor/­twig/­twig/­lib/­Twig/­Template.php156
  11. Twig_Template displayBlock …/­cache/­twig/­b/­7/­b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852.php35
  12. __TwigTemplate_b7abd74b05daea6b6c4cd36d4a00f4a01012c89fb79a4f1a51d10b380edc9852 doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  13. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  14. Twig_Template display …/­cache/­twig/­9/­3/­936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe.php45
  15. __TwigTemplate_936ebf83f51e9f7094080046e14650e309d952a79d10e05ad54f39c7f1656dfe doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  16. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  17. Twig_Template display …/­cache/­twig/­c/­d/­cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208.php74
  18. __TwigTemplate_cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208 doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  19. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  20. Twig_Template display …/­cache/­twig/­c/­d/­cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208.php74
  21. __TwigTemplate_cde21e0d5db30945084a0138d85d69fb43c7926e6a0f0c54fa4bd03b66add208 doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  22. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  23. Twig_Template display …/­cache/­twig/­6/­d/­6d2099856c084c49060b74f7ace9ef2c737023acd0aa7b6451ecd13e9a27a461.php60
  24. __TwigTemplate_6d2099856c084c49060b74f7ace9ef2c737023acd0aa7b6451ecd13e9a27a461 doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  25. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  26. Twig_Template display …/­cache/­twig/­9/­3/­934816f494650954d72df4320acf423a2c343a2920cdf5b041e8e16cc38301ca.php96
  27. __TwigTemplate_934816f494650954d72df4320acf423a2c343a2920cdf5b041e8e16cc38301ca doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  28. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  29. Twig_Template display …/­cache/­twig/­9/­6/­964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1.php136
  30. __TwigTemplate_964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1 block_content …/­vendor/­twig/­twig/­lib/­Twig/­Template.php156
  31. Twig_Template displayBlock …/­cache/­twig/­a/­9/­a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1.php271
  32. __TwigTemplate_a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1 block_page …/­vendor/­twig/­twig/­lib/­Twig/­Template.php156
  33. Twig_Template displayBlock …/­cache/­twig/­a/­9/­a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1.php40
  34. __TwigTemplate_a92d319063e8c81d7b54776e17cbeffa7eb92906aaf1bf6163d3a624d85d8dd1 doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  35. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  36. Twig_Template display …/­cache/­twig/­9/­6/­964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1.php44
  37. __TwigTemplate_964cc76c1362078cc6cf8253b3639bd068b15729be8b0a51349efd2d714f9cd1 doDisplay …/­vendor/­twig/­twig/­lib/­Twig/­Template.php333
  38. Twig_Template displayWithErrorHandling …/­vendor/­twig/­twig/­lib/­Twig/­Template.php307
  39. Twig_Template display …/­vendor/­twig/­twig/­lib/­Twig/­Template.php318
  40. Twig_Template render …/­vendor/­twig/­twig/­lib/­Twig/­Environment.php293
  41. Twig_Environment render …/­system/­src/­Grav/­Common/­Twig/­Twig.php324
  42. Grav\Common\Twig\Twig processSite …/­system/­src/­Grav/­Common/­Grav.php143
  43. Grav\Common\Grav Grav\Common{closure} …/­vendor/­pimple/­pimple/­src/­Pimple/­Container.php112
  44. Pimple\Container offsetGet …/­system/­src/­Grav/­Common/­Grav.php231
  45. Grav\Common\Grav process …/­index.php31

Hope that helps ... let me know if there is anymore more you might need.

Brian U.

Sommerregen commented 8 years ago

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?

ghost commented 8 years ago

No change.

Sommerregen commented 8 years ago

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.

ghost commented 8 years ago

Yes, that seems to have worked. I now have access to the plugin settings under Admin Panel. It also seems to install correctly too.

Sommerregen commented 8 years ago

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.

sheldonkotyk commented 8 years ago

Happening for me. I believe it is due to the media embed plugin

Sommerregen commented 8 years ago

@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 :smile:.

sheldonkotyk commented 8 years ago

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.

rdsaunders commented 8 years ago

I'm also able to replicate this on a fresh install on a digital ocean droplet. It only appears to occur with the MediaEmbed plugin. The exception isn't thrown against any other plugin that I have installed.

exception