[TYPO3-mvc] Object Validator executes multiple times

Markus Klein klein.t3 at mfc-linz.at
Thu Oct 3 01:29:38 CEST 2013


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





More information about the TYPO3-project-typo3v4mvc mailing list