[TYPO3-mvc] ControllerAction dispatched twice
Michael Feinbier
mf at hdnet.de
Wed Feb 3 16:57:04 CET 2010
Hey everybody,
I've encountered a very strange problem on a site which uses extbase(d)
controller/action plugins.
In a sendAction() an single email will be sent to a user. The
sendAction() is called from a POST Form which contains the values. the
strange problem is, that the sendAction() is called TWICE in one
request. As a result the email will be sent 2 times.
The view itself gets rendered only one time.
I verified it by setting a static execCount:
static public $execCount = 0;
My sendAction() looks like:
> public function sendAction(array $brochure) {
> $validation = $this->validateForm();
>
> if(is_array($validation)) {
> $this->view->assign('errors',$validation);
> $this->forward('bestellen',NULL,NULL,array('errors' => $validation,'brochure' => $brochure,'noCache' => 1,'data' => $this->uriBuilder->getRequest()->getArguments()));
> }
>
> $this->view->assign('prospekte',$this->programmRepository->findByUidList(implode(',',$brochure)));
> $this->view->assign('values',$this->uriBuilder->getRequest()->getArguments());
> $bodyText = $this->view->fetch( 'mail.txt' );
> $this->view->assign('text',$bodyText);
>
> self::$execCount++;
> echo self::$execCount;
>
> $this->sendEMail( $bodyText );
> }
The output (from echo self::) is 12 which shows, that the method is
executed two times. But why? It is not the case in my indexAction() or
somewhere else.
Thanks for any ideas.
Michael
More information about the TYPO3-project-typo3v4mvc
mailing list