Closed giovkanata closed 7 years ago
Thanks for the fast reply @craue !
I've already readed it carefully many times in the last 2 days but I was not be able to get the point.
I've used the form_options
to add a specific validation group for each step and I've also tried to use flow_registrationCompletionForm_step2
(obviously changing the DTO's properties) as written in the docs but without success (I never saw where is my error).
PS: I'm not a native english speaker and maybe is for this that I cannot see it. I really would like to find the error myself but I think I need a clue :-)
Could you set up a fork of the Symfony Standard Edition or the demo bundle to demonstrate the issue?
As you suggested I've spent other time reading again the "Validation groups" section and then trying to use the auto generated validation group for the flow. But the auto generated flow_registrationCompletionForm_step2
validation group added to the properties of the CustomerPersonalDataDTO
did not were recognised at all. Same behavior If I use the form_options
to add a custom validation group for each step as described by the docs. I really don't understand where is the problem or where I make an error, because I followed exactly what described in the docs. I will appreciate if someone could point me in the right direction to let me see where the error is. PS: I will do the fork tomorrow :-)
Hi @craue ! I've directly created a new project using a fresh new Symfony 3.2.* installation + your bundles. I've added only the files necessary to reproduce the error. You will find the project at CraueFormFlowTest. The same error happens again when you try to submit the 2 step of the form. Let me know if you need something more.
The setter public function setBirthDate(\DateTime $birthDate)
must allow a null
value as well. The model is first populated with data and validated afterwards. So change this to public function setBirthDate(\DateTime $birthDate = null)
.
Shame on me that I didn't notice that from the error message you posted initially. :flushed:
OMG @craue ! And to think that today, before leaving home, I wanted to do that test. I don't know why I always thought that the validation is performed directly on the data passed by the form without binding it to the model. Sorry!
First of all thanks for this bundle, very usefull (it's a time saver :-)). I have a step form using the "Approach A: One form type for the entire flow" and all works as expected until the validation of the 2° step where I need to validate the
RegistrationCompletionDTO:$personalData
using the@Valid
contraint. But on form submit the errorin
tell me that the
@Valid
constraint annotation was not recognised/triggered (also using the "Default" validation group, instead of "Personal" doesn't resolve the issue).PS: I posted only the minimal code related to the problem but fell free to ask if you need more.
My RegistrationCompletionFormFlow:
My RegistrationCompletionForm:
My RegistrationCompletionDTO:
My CustomerPersonalDataDTO:
How can I resolve this issue? I'm forced to use the "Approach B: One form type per step" because the
@Valid
constraint it's simply not supported or there is something I've missed? Thanks for your time.