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

Collections with just 1 item in them should be loopable #1402

Closed
nealmarques opened this issue May 22, 2020 · 1 comment · Fixed by #1412
Closed

Collections with just 1 item in them should be loopable #1402

nealmarques opened this issue May 22, 2020 · 1 comment · Fixed by #1412
Assignees
Labels
🐛 tag: bug

Comments

@nealmarques
Copy link

nealmarques commented May 22, 2020

I have a content type with a collection of sets. If I only add 1 set in that collection, i'm not able to iterates over that collection with for loop; the code inside the loop will never execute.

I suppose this happens because the array is never created if its just one set. An array should always be returned, this way the template developer doesn't need to duplicate code to catch the 1 set case.

| Relevant Bolt Version | version4.0.0 RC 17
| Install type | Composer install
| BC Break | yes/no
| PHP version | 7.3
| Web server | Built-in

@I-Valchev
Copy link
Member

I-Valchev commented May 22, 2020

@bobdenotter hmm, we fixed that today, but... does it apply to collections I didn't think so

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

Successfully merging a pull request may close this issue.

3 participants