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

Fix collection template for not numeric children keys #6280

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

zorn-v
Copy link
Contributor

@zorn-v zorn-v commented Apr 24, 2024

Fix #6277

@@ -137,7 +137,7 @@
'data-entry-is-complex': form.vars.ea_vars.field and form.vars.ea_vars.field.customOptions.get('entryIsComplex') ? 'true' : 'false',
'data-allow-add': allow_add ? 'true' : 'false',
'data-allow-delete': allow_delete ? 'true' : 'false',
'data-num-items': form.children is empty ? 0 : max(form.children|keys) + 1,
'data-num-items': form.children is empty ? 0 : form.children|length,
Copy link
Contributor

@Seb33300 Seb33300 May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work if the array has numeric keys not starting by 0.
And it's quite common to use the entity id as the index.

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.

PR #6200 : Unsupported operand types: string + int
2 participants