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

Avoid to pass empty array as argument 3 for implementations of ModelManagerInterface::addIdentifiersToQuery() #6509

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

phansys
Copy link
Member

@phansys phansys commented Oct 20, 2020

Subject

Avoid to pass empty array as argument 3 for implementations of ModelManagerInterface::addIdentifiersToQuery().

I am targeting this branch, because this change respects BC.

Closes #6508.

Changelog

### Fixed
- Passing an empty array as argument 3 for implementations of `ModelManagerInterface::addIdentifiersToQuery()`.

@phansys phansys added the patch label Oct 20, 2020
@phansys phansys marked this pull request as ready for review October 20, 2020 11:30
@phansys phansys requested a review from a team October 20, 2020 11:30
@phansys phansys requested a review from a team October 20, 2020 11:55
@jordisala1991 jordisala1991 merged commit 8e9583b into sonata-project:3.x Oct 20, 2020
@jordisala1991
Copy link
Member

Thank you @phansys

@phansys phansys deleted the model_manager_ids branch October 20, 2020 16:09
@jorrit
Copy link
Contributor

jorrit commented Oct 22, 2020

@phansys Why not just return new ArrayCollection() when $value === [] ? The count checking is not needed in this case.

@phansys
Copy link
Member Author

phansys commented Oct 22, 2020

@phansys Why not just return new ArrayCollection() when $value === [] ? The count checking is not needed in this case.

I agree that the count checking is not needed.
I didn't add an early return in order to keep the responsibility of the Collection implementation in TraversableToCollection::transform() using the existing code.
If you think it could be improved, please feel free to open a PR.

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

Successfully merging this pull request may close these issues.

Related items which are optional result in a query error
4 participants