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

batch filter clobbers array keys when fill parameter is used #2568

Closed
abunch opened this issue Oct 12, 2017 · 4 comments
Closed

batch filter clobbers array keys when fill parameter is used #2568

abunch opened this issue Oct 12, 2017 · 4 comments
Labels

Comments

@abunch
Copy link

abunch commented Oct 12, 2017

batch filter clobbers array keys when fill parameter is used

On the last array chunk if there are fewer keys than the chuck size when the batch filter fills in the missing value it re-numbers the array keys.

@SpacePossum
Copy link
Contributor

Hi and thanks for reporting!

Could you maybe create a small twig fiddle to illustrate the issue?

@abunch
Copy link
Author

abunch commented Oct 13, 2017

Here ya go! Let me know if there's anything else I can help with.

https://twigfiddle.com/s99ba0

@fabpot
Copy link
Contributor

fabpot commented Mar 12, 2019

fixed by #2884

@fabpot fabpot closed this as completed Mar 12, 2019
fabpot added a commit that referenced this issue Mar 12, 2019
…s used " (fabpot)

This PR was squashed before being merged into the 1.x branch (closes #2884).

Discussion
----------

Fix "batch filter clobbers array keys when fill parameter is used "

closes #2568

Commits
-------

750cb23 fixed batch filter clobbers array keys when fill parameter is used
ede9a60 added preserveKeys support for the batch filter
@ericmorand
Copy link
Contributor

Why has it been fixed? There is nothing in the documentation about the keys:

https://twig.symfony.com/doc/2.x/filters/batch.html

The values of the keys are undefined, based on the documentation. Your fix is a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants