[Flow] strange behaviour w. select/multiple and spl_object_hash
Tomas M
flow at 46dev.de
Wed May 6 15:01:35 CEST 2015
Hello,
I've a strange effect when using a selectbox in combination with multiple attribute:
this box ist filled via controllers newAction reprository->findAll().
In my test case the model has only two properties "$name" of type string and
$items of type \Doctrine\Common\Collections\Collection<\xyz\project\Domian\Model\item>
Both props are mandatory, at least one "item" must be choosen.
The selectbox has N options plus one option "please select" with option value "" (empty string).
By opening the form the selectbox is blank (no text).
If one sends the empty form, it reopens with correct error messages.
Afterwards the selectbox says "please select", I fill the name field and send the
form. This results in exception "spl_object_hash() expects parameter 1 to be object, null given..."
When I remove the multiple attribute, no exception is thrown!
Question: the items collection has a Flow validation @Flow\Validate(type="NotEmpty")
Why is the exception thrown only if the selectbox is of type multiple and
why the validation not used first?
Has someone an idea?
More information about the Flow
mailing list