Tested on new installs of
Environment:
Repro steps:
system/blueprints/pages/default.yaml (just for speed, but I can reproduce the bug with a page blueprint found in a theme as well)content tab, add this field (line 38): header.content.items:
label: Pages
type: pages
multiple: true
Expected result: No error.
Actual result:
Whoops \ Exception \ ErrorException (E_NOTICE)
Array to string conversion
This does not happen if the field doesn't have multiple: true. I also tried adding validation: type: array but it doesn't fix it.
Update: This error doesn't occur when
validation:
type: commalist
is added to the field in the blueprint.
FYI, you shouldn't be modifying the system blueprints. If you want to add a field you should do it with an override. Look at the antimatter theme in the blueprints/pages folder for some relevant examples.
I know, this happens when doing it in a theme as well. So this is not considered a bug? I think at least the error message could be a little more helpful.
hmm.. I guess we could auto-handle forcing comma list in pages field when multiple is true.. I'll open her up again.
Can confirm that this is a bug, and that adding:
validate: # NOT `validation`
type: commalist
to the field in question does seem to work for my case. The field in its entirety being:
header.associated_products:
type: pages
multiple: true
label: Products applicable for this warranty
validate:
type: commalist
To reproduce the exception OP was talking about, just remove the two lines beginning at validate and try to save the page.
I have the same problem with filepicker or pagemediaselect when saving i've got this error.

And if i add validate type commalist i have this error :

I got the exact same problem as @Amorfx. Any update about this bug?
I would like to use pagemediaselect field with attribute multiple to true. (as the doc say, it's possible)
I tried to add a field like this from a blueprint:
header.hero_images:
ordering@: 2
type: pagemediaselect
multiple: true
label: Choose header image
style: vertical
preview_images: true
accept:
- .jpg
- .png
As suggested above, I've also tried to add:
validation:
type: commalist
Sadly nothing work I always get a Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Array to string conversion").
Hello there,
I get the same error when using the "filepicker" field inside a config yaml file. Is there any new insight on this problem?
Hi there
I have the same problem with pagemediaselect.
Before adding the validate part I get the Array to string conversion error mentioned previously. After adding it i get another one but this time in twig (same as @Amorfx ).
My setup:
header.gallery:
type: pagemediaselect
label: Gallery
multiple: true
validate:
type: commalist
Most helpful comment
I have the same problem with filepicker or pagemediaselect when saving i've got this error.

And if i add validate type commalist i have this error :