[Flow] Ignore validation errors for related object
Steffen Wickham
steffen at gaming-inc.de
Tue May 21 11:19:22 CEST 2013
The errorAction will only be called by the MVC part of the framework, if
there is no callable method found, e.g. you try to call your update
action but forgot the "Action" part in your function name, as it happens
very often for me. ;-)
There is a getErrorFlashMessage() function which allows you to provide
custom FlashMessages instead of the automatic generated "An error
occurred while trying to call CLASSNAME->METHODNAME" message. But there
is no way to interrupt the validation through this method as it is
already done before this method is invoked.
The right point would be the initializeUpdateAction() for manipulating
your values, I guess. You can access all submitted values through
$this->request->getArguments(), manipulate everything and write it back
($this->request->setArguments( YOURARRAY ); ).
Am 21.05.13 10:41, schrieb Stephen Bungert:
> I see also now that there is an errorAction in Flow. Would it be a good idea
> to try and do something here to ignore the validation errors? is that
> possible?
>
> Stephen.
>
>
> "Steffen Wickham" <steffen at gaming-inc.de> schrieb im Newsbeitrag
> news:mailman.151.1369125031.570.flow at lists.typo3.org...
>> Hello Stephen,
>>
>> did you add "@ORM\Column(nullable=true)" to your image property? How do
>> you annotate the property and implement the setter/getter methods for
>> it? Please provide us a little bit more details :)
>>
>> Best regards,
>> Steffen
>>
>>
>> Am 19.05.13 11:30, schrieb Stephen Bungert:
>>> I have a form for my main objects - books, they have a onetoone
>>> relationship with another object - an image, but an image isn't
>>> required. The problem is, that this object has two fields that are
>>> required, so my main object's update action reports validation errors.
>>>
>>> I can create books with images, and images can be deleted too, but I
>>> can't save my book without validation errors because of the required
>>> fields in the image object.
>>>
>>> Is there anyway of over-riding these errors in my book's update action?
>>>
>>> Thanks for any help.
>>>
>>> Stephen.
>>> _______________________________________________
>>> Flow mailing list
>>> Flow at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list