[TYPO3-mvc] Disable recursive validation | objectstorage
Bas van der Togt
bas at profinit.com
Tue Jul 15 13:58:33 CEST 2014
Hello Philipp,
Thanks for your comment!
Based on your response, I see that i have not been very clear.
I will be more specific.
I have a model with an ObjectStorage inside.
When the model validates the property 'alternatives' (ObjectStorage) is
filled with some data from an external resource . However when i submit
the same form again the objectstorage is validated too.
Model:
Animal (\Hc\Be\Domain\Model\Animal)
@var \string
@validate \Hc\Be\Domain\Model\Animal\Validation\Validator
\AnimalValidator
name
@var
\TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Hc\Be\Domain\Model\Animal>
alternatives
So my question is how to prevent validation for my ObjectStorage (with a
second request).
@ignorevalidation won't work because then the parent object is not
validated as well.
Hopefully you know a solution for this :-)
Regards,
Bas
Philipp Wrann schreef op 14-07-14 15:27:
>> These models are attached to the objectstorage from an external resource
>
> i think i dont get it...
>
> If you are in a crud context (so you want to create the object) you can
> set the validation options in the initialize method.
>
> eg: public function initializeCreateAction() {}
>
> There you can access the http request ($this->request) and make some
> adjustments needed.
>
> If you are in a simple list/display context make use of the method
> annotation
> @ignorevalidation $paramIgnoredInValidation
>
> An make sure you are only passing the objects uid, that can prevent some
> troubles.
More information about the TYPO3-project-typo3v4mvc
mailing list