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

Pagemediaselect: Error when saving

Started by Muut Archive 10 years ago · 1 replies · 674 views
10 years ago

I wanted to extend the blueprint of a page by adding a pagemediaselect field, which works perfectly when it's set to "single item".

YAML
header.images:
    type: pagemediaselect
    label: Images

But when I add multiple: true the page can't be saved anymore. Whoops says it is due to an Array to string conversion error, after trying to save the page with some images selected.
I also checked this behavior by adding an selectize field to the blueprint (which I think should theoretically work similar), but it worked flawlessly.

10 years ago

I had the same problem when using multiple pages field. I was able to solve this by adding validate.type:

YAML
header.pages:
   type: pages
   label: Pages
   multiple: true
   validate:
       type: array

It might help you or point you to the right direction.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1999 9 years ago
Archive · by Muut Archive, 9 years ago
2 1342 9 years ago
Archive · by Muut Archive, 9 years ago
2 4548 9 years ago
Archive · by Muut Archive, 9 years ago
1 3401 9 years ago
Archive · by Muut Archive, 9 years ago
3 1493 9 years ago