[TYPO3-mvc] Object Validator executes multiple times
Markus Klein
klein.t3 at mfc-linz.at
Sat Oct 5 15:58:29 CEST 2013
Any feedback on this?
Kind regards
Markus
------------------------------------------------------------
Markus Klein
TYPO3 CMS Active Contributors Team Member
> -----Original Message-----
> From: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-
> project-typo3v4mvc-bounces at lists.typo3.org] On Behalf Of Markus Klein
> Sent: Thursday, October 03, 2013 1:30 AM
> To: typo3-project-typo3v4mvc at lists.typo3.org
> Subject: [TYPO3-mvc] Object Validator executes multiple times
>
> Hi!
>
> I’m writing a brand new extbase extension.
> In its very basic form it now contains two Models: Order and
> PaymentMethod PaymentMethod is currently unused.
>
> I’ve written an object validator OrderValidator to check the an Order.
>
> I currently have only one controller with two actions:
> /**
> * action new
> *
> * @param Order $newOrder
> * @ignorevalidation $newOrder
> * @return void
> */
> public function newAction(Order $newOrder = NULL) {
> $this->view->assign('newOrder', $newOrder);
> }
>
> /**
> * action create
> *
> * @param Order $newOrder
> * @return void
> */
> public function createAction(Order $newOrder) {
> $this->orderRepository->add($newOrder);
> $this->redirect('new');
> }
>
> So once I'm submitting the form my OrderValidator is executed twice. Since
> the validation fails I come back to the newAction and the form then contains
> all error messages twice.
> Debugging shows that my validator is called twice already when extbase tries
> to access the createAction, which is aborted then and comes back to the new
> action via the error action.
>
> I've found an old issue http://forge.typo3.org/issues/10756
>
> I'm running on 6.2, current master.
> (I'm using the new propertyManager, since it is enabled by default now.)
>
> Does anybody have a clue what I do wrong?
>
> Kind regards
> Markus
>
> ------------------------------------------------------------
> Markus Klein
> TYPO3 CMS Active Contributors Team Member
>
>
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list