Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Error with admin plugin - An exception has been thrown during the rendering of a template ("Array to string conversion")

admin

Solved by Ptarmic View solution

Started by Ptarmic 6 years ago · 2 replies · 1014 views
6 years ago

I'm running Grav v1.7.0-rc.17
In the admin panel I try and click to open the admin plugin or click on the "update available!" button and I get the error: An exception has been thrown during the rendering of a template ("Array to string conversion").

which looks to be coming from /user/plugins/form/templates/forms/fields/select/select.html.twig
other than that I don't know where to look to look into this further.

image|690x388

6 years ago

From what shown in screen shoot. val, value or item_value is an array and not a text. (you need array to string conversion)

Either the bugs is on rc-17 or in the plugins.

6 years ago Solution

After a lot of troubleshooting the cause of this error was the translation function on the select field /user/plugins/form/templates/forms/fields/select/select.html.twig.

I have multiple languages on the site and some of the keys in language file clashed with the twig template files. Also my keys were all lowercase which is not best practice for Grav. I changed all the keys to uppercase and renamed some so as not to directly match twig file names. eg. blog_item: to BLOG_ITEM_Fields

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 49 1 week ago
Plugins · by Xavier, 4 weeks ago
2 57 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1184 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 75 2 months ago