Skip to content

Conversation

@oleg-andreyev
Copy link
Contributor

  • Form Data may be not iterable, so need to throw an exception if data is not iterable
  • When working with ArrayCollection it's already iterable, so need to cast to array

@matthiasnoback
Copy link
Owner

Thanks for making this PR. What's missing for me is a test case that shows when this is indeed a problem. I understand why you need this, but I want to ensure that the feature "this library works with iterables in general" also keeps working in the future, etc. So can you take a look at the tests and add a form type that shows how you're using a form field with a collection? Feel free to add doctrine/collections as a dev dependency, so you can mimic a real-world scenario.

@oleg-andreyev
Copy link
Contributor Author

@matthiasnoback added a test case.

@matthiasnoback
Copy link
Owner

Sorry, I merged the other PR first. Can you take a look at the tests and make them pass?

@oleg-andreyev oleg-andreyev force-pushed the dont-cast-form-data-to-array-if-its-not-iterable branch from c0dd5db to 3f9f4b4 Compare December 5, 2020 18:39
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.

2 participants