I ran into this problem which I cannot solve.
One of my forms has a requirement to filter entities.
A bit of background:
The form is to add a new task to the workflow step. The tasks that can be selected depend on what stage of the workflow the user is on, which product is assigned to the workflow and the company that manages this workflow.
I tried to add a filter request to the "query_builder" section, and I tried to put the result of the query from the entity repository into the "options" section in the array.
However, the form always returns, saying that the field I'm working on is not valid. The most mysterious part is without the "election" field, for example, when ALL entries are entered for this object, the selection field is exactly the same (with several additional entries) - the name and template of how it is written. And it works great. Therefore, I do not know what is happening.
Form element code:
->add('instructionAction', 'entity', array( 'label' => 'Action', 'empty_value' => 'Select Action', 'required' => true, 'class' => 'ApplicationTrackpadCommonBundle:InstructionAction', 'property' => 'description', 'choices' => $this->instructionActionRepository->findAllForCaseInstruction( $options['caseInstructionId'] ) ) )
I'm not sure how much code I can publish, as it is designed to work with the client. In the query that I use, the drop-down list is correctly populated, as it would be without the query, and even if I select all the objects without any WHERE clauses, the same problem occurs.
Thanks for any help.