Skip to content

[8.x] Fix attributes returning a collection instead of an array #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kailumworkhouse
Copy link
Contributor

Following on from statamic/cms#11333

Fix implemented through runway.

@duncanmcclean duncanmcclean changed the title [7.x] Fix attributes returning a collection instead of an array [78x] Fix attributes returning a collection instead of an array Feb 7, 2025
@duncanmcclean duncanmcclean changed the title [78x] Fix attributes returning a collection instead of an array [8.x] Fix attributes returning a collection instead of an array Feb 7, 2025
@duncanmcclean duncanmcclean changed the base branch from 7.x to 8.x February 7, 2025 15:43
@duncanmcclean duncanmcclean merged commit 9a6a3d5 into statamic-rad-pack:8.x Feb 17, 2025
15 checks passed
Copy link

Released as part of v8.0.1.

@duncanmcclean
Copy link
Member

Rolling this back as its caused a breaking change.

You can likely workaround the issue you were seeing by changing the casts on your model to json or array, instead of (presumably) collection.

@simonworkhouse
Copy link
Contributor

@duncanmcclean Unfortunately we cannot change the cast types in our use-case, but in my opinion the issue really lies within statamic/cms. I'd suggest that it's incorrect behaviour for the Statamic select field type to wrap collections in an array, see statamic/cms#11333

Do you think that we could re-open that issue?

@duncanmcclean
Copy link
Member

Are you able to open an issue on the Runway repo, with an example repo demonstrating the issue and I can take a look when I have a chance.

I have a feeling it's probably something that should be fixed on the Runway side (I might be wrong), but we just need to figure out a way to fix it without breaking relationships for others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants