[TYPO3-dev] Dispatch Error after adding Boolean Property to Demand Class
g4-lisz at tonarchiv.ch
g4-lisz at tonarchiv.ch
Wed Feb 8 18:38:46 CET 2012
He there
In my extbase project i'm using a non-persistent object "Demand" for a
search form. Everything worked fine...
Now i added a new property "isLocalKanton" to this Demand class:
/*
* Local to Kanton
*
* @var boolean $isLocalKanton
*/
protected $isLocalKanton = false;
/**
* @param boolean $isLocalKanton
* @return void
*/
public function setIsLocalKanton($isLocalKanton) {
$this->isLocalKanton = (boolean)$isLocalKanton;
}
/**
* @return boolean isLocalKanton
*/
public function getIsLocalKanton() {
return $this->isLocalKanton;
}
In the view i added a checkbox to the form:
<f:form name="demand" pluginName="fe_search_results" object="{demand}"
action="results" pageUid="26">
<f:form.checkbox property="isLocalKanton" value="1" />
[...]
</f:form>
Before this change, everything worked flawlessly with other boolean
properties.
Now i get the error: "Could not ultimately dispatch the request after
101 iterations. Most probably, a @dontvalidate annotation is missing on
re-displaying a form with validation errors."
Why is this? I can't see any mistake in my code...
The action for displaying the search form looks like this:
/**
* Displays Fachabteilung Search Form
*
* @param Tx_Hplusinfo_Domain_Model_SearchDemand $demand The optional
default values
* @return void
* @dontvalidate $demand
*/
public function abteilungAction(Tx_Hplusinfo_Domain_Model_SearchDemand
$demand = NULL) {
if ($demand === NULL) {
$demandSession =
unserialize($GLOBALS["TSFE"]->fe_user->getKey("ses", "demand"));
if ( ($demandSession instanceof
Tx_Hplusinfo_Domain_Model_SearchDemand)
&& ($demandSession->getPageId() == $GLOBALS["TSFE"]->id)
) {
$demand = $demandSession;
}
else {
$demand = new Tx_Hplusinfo_Domain_Model_SearchDemand();
$GLOBALS["TSFE"]->fe_user->setKey("ses", "demand", NULL);
}
}
$this->view->assign('demand', $demand);
$this->view->assign('abteilungs',
$this->abteilungRepository->findAll());
}
If i the form checkbox is commented out, the error disappears. Again,
all other checkboxes work fine!
I commented out the catch {} in the dispatcher loop
(typo3_src-4.6.1/typo3/sysext/extbase/Classes/MVC/Dispatcher.php:93).
Now it throws a Tx_Extbase_MVC_Exception_StopAction in
/typo3_src-4.6.1/typo3/sysext/extbase/Classes/MVC/Controller/AbstractController.php:277:
public function forward($actionName, $controllerName = NULL,
$extensionName = NULL, array $arguments = NULL) {
$this->request->setDispatched(FALSE);
$this->request->setControllerActionName($actionName);
if ($controllerName !== NULL)
$this->request->setControllerName($controllerName);
if ($extensionName !== NULL)
$this->request->setControllerExtensionName($extensionName);
if ($arguments !== NULL)
$this->request->setArguments($arguments);
throw new Tx_Extbase_MVC_Exception_StopAction();
}
The request is forwarded to another action? Maybe that's a hint for
someone who knows the mechanisms..
Any help will be much appreciated!
Cheers, Till
More information about the TYPO3-dev
mailing list