Skip to content

Fix email fields not being loopable - #5375

Merged
jasonvarga merged 1 commit into
masterfrom
fix/form-email-data
Feb 28, 2022
Merged

Fix email fields not being loopable#5375
jasonvarga merged 1 commit into
masterfrom
fix/form-email-data

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

Fixes #5360

This PR will reindex the collection so it'll work across parsers.


Turns out the old parser allowed looping over non-numerically-indexed collections, but only if they were a collection. Arrays didn't work. We never documented it as working though.

Numerically-indexed array:

field:
  - # technically 0
    title: Alfa
  - # technically 1
    title: Bravo
{{ field }} {{ title }} {{ /field }} // Works fine. Outputs: Alfa Bravo

Non-numerically indexed

field:
  foo:
    title: Alfa
  bar:
    title: Bravo
{{ field }} {{ title }} {{ /field }} // This shouldn't work, but was, but only if it was a collection.

I don't consider this a parser bug since it's an undocumented case.

@jasonvarga
jasonvarga merged commit d816a28 into master Feb 28, 2022
@jasonvarga
jasonvarga deleted the fix/form-email-data branch February 28, 2022 23:38
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