Array to string conversion error when relating entries from Pages collection #4337
Replies: 3 comments 2 replies
-
Yes, start removing content until it works, then continue to narrow it down to find the content causing the problem. Then we can dig into that. |
Beta Was this translation helpful? Give feedback.
-
My hunch is that you have a similar named field in both collections but they use different fieldtypes. You could resolve that by using consistent fieldtypes, or changing the field name of one of them. |
Beta Was this translation helpful? Give feedback.
-
Thanks @jasonvarga and @edalzell Using your suggestions I was able to narrow it down and find the issue. Basically I had a I solved this for now by renaming the handle of the field in the main Blueprint to I did generally set up this pattern with some intention:
While it's not that hard to adjust field names as you go - or alternatively I could make the text inputs
So I'm just curious as to why this was only throwing an error when I tried to associate one page to another via the Entries field type? All good if it is just the way it is - I'm just curious and it might help me design better content patterns going forward. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I'm getting an error whenever I try and relate entries specifically from the Pages collection.
[2021-09-30 06:10:23] local.ERROR: Array to string conversion {"userId":"e8ffc1e8-100f-4c68-a6c5-d93b56f82435","exception":"[object] (ErrorException(code: 0): Array to string conversion at ....../vendor/statamic/cms/src/Fieldtypes/Text.php:87)
I've encountered this in two situations:
In both cases, everything is seemingly working until I click on the action that triggers the modal to select the entry(ies) - see screenshot below.
I realise that this may be due to some error within my content yaml files... if that's the likely cause, is there any way to narrow it down, since there's a fair bit of content already in the site to sift through.
For example:
input_type: text
?content
- https://statamic.com/forum/370-array-to-string-conversion-when-creating - of which I have a few but I'm guessing this shouldn't be an issue?Thanks for any suggestions!
Beta Was this translation helpful? Give feedback.
All reactions