Skip to content
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

[5.x] Allow Values object and Group fieldtype to be iterated #11182

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Nov 27, 2024

This replaces #10958.

This fixes an issue where you could not use the foreach tag to loop over a group fieldtype.

The underlying issue is that when you have a Value instance that evaluates to a Values instance (which is what the group fieldtype does), it wasn't properly iterable. getIterator expects a Traversable to be returned.

In the included test, the last dataset (value with values) is the one that would fail, and is fixed by this PR.

@jasonvarga jasonvarga merged commit aef574f into 5.x Nov 27, 2024
19 checks passed
@jasonvarga jasonvarga deleted the iterate-group branch November 27, 2024 22:43
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.

1 participant