-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
The to_json
modifier doesn't handle nested query builders
#5866
Comments
The issue here is that each assets field is a query builder instance. So it's moreso a problem with the Are you actually intending on just smushing the whole grid into a JSON object like that or were you just playing around before using it another way? |
to_json
modifier doesn't handle nested query builders
I'm just trying to display an image/s inside of a replicator set. I want to pass the whole replicator set including the images into a So Ideally as 1 big object, however the images inside the replicator set are only the query builder instance (a reference) and not the image data itself, so I need to then loop through these again (to get the actual image data) to somehow pass it to my
|
I have the same problem with 3.3.x. I think it was working OK in 3.2, I will need to check. Until then I've created a custom modifier to augment these query builders before |
Generally since 3.3.x several of our websites have issues. All of them have fairly complicated setups for example a In this |
Seems related to: #6074 |
They don't seem related, but I could be wrong. It seems related to this change: https://statamic.dev/upgrade-guide/3-2-to-3-3#entries-fieldtype My guess, when this query build is nested inside another fieldtype it's not being augmented correctly when passed to a modifier like However since |
I've managed to reproduce this bug and created a repository demonstrating it (from #6130).. |
This has been added/fixed in Statamic 5, which we're hoping to release in the next few days/weeks. |
Bug description
I've added an Assets field inside of a replicator. I've uploaded 1 or multiple images which adds the image/s to the .md file. I can view and change the images in the CP, however when I view the object it is empty.
How to reproduce
Create a Replicator, add images to the set. Show the image
{{imageset | to_json | entities }}
Logos shows an empty object, I can view title
[{"title”:”test”,”logos":{},"type”:”test1”},{“title”:”another,”logos":{},"type”:”test”2}]
Logs
No response
Versions
php 8.1
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
No response
Additional details
Laravel Sail
The text was updated successfully, but these errors were encountered: