Ok, ich habe jetzt einiges debugged. Zu folgendem Schluss bin ich nun gekommen.
In der "Tx_Extbase_MVC_Controller_ActionController::errorAction()" kommen alle Daten sauber an, auch ein "forward" wird aufgerufen. D.h. die Validierung funktioniert, denn im "$referringRequest" Object, welches der "forward" Methode übergeben wird, steht als Action "showForm" und nicht "submitForm".
Die "forward" Methode ist in der Klasse "Tx_Extbase_MVC_Controller_AbstractController" definiert:
<?php
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();
}
?>
Gebe ich hier das "$request" Object aus, erhalte ich folgende Daten: hier steht als controllerAction "submitForm". Diese Information wird zwar nicht in der "forward" Methode genutzt, aber vielleicht hat das ja wo anders dann seinen Einfluss?!
Extbase Variable Dump
Tx_Extbase_MVC_Web_Requestprototype object
hashService => Tx_Extbase_Security_Cryptography_HashServicesingleton object
format => 'html' (4 chars)
method => 'POST' (4 chars)
requestUri => 'https://www.mydomain/de/kontakt/anfahrt-kontakt.html?tx_mycontactform_p
i1%5Baction%5D=submitForm&tx_mycontactform_pi1%5Bcontroller%5D=ContactFo
rmItem&cHash=9e2e56777f1c4a856f2da71cb9416da8' (193 chars)
baseUri => 'https://www.mydomain.de/' (26 chars)
hmacVerified => TRUE
isCached => FALSE
configurationManager => Tx_Extbase_Configuration_ConfigurationManagersingleton object
controllerObjectNamePattern => 'Tx_@extension_@subpackage_Controller_@controllerController' (58 chars)
pluginName => 'Pi1' (3 chars)
controllerExtensionName => 'MyContactform' (13 chars)
controllerSubpackageKey => NULL
controllerName => 'ContactFormItem' (15 chars)
controllerActionName => 'submitForm' (10 chars)
arguments => array (3 items)
action => 'submitForm' (10 chars)
controller => 'ContactFormItem' (15 chars)
newContactFormItem => array (5 items)
internalArguments => array (2 items)
dispatched => TRUE
originalRequest => Tx_Extbase_MVC_Web_Requestprototype object
originalRequestMappingResults => Tx_Extbase_Error_Resultprototype object
errors => array (empty)
Das ShowForm.html Template sieht folgendermaßen aus:
<f:layout name="Default" />
<f:section name="main">
<h1>Kontaktformular</h1>
<f:flashMessages />
<f:render partial="FormErrors" arguments="{object:ContactFormItem}"/>
<f:form action="submitForm" method="post" name="newContactFormItem" object="{newContactFormItem}">
<f:render partial="ContactFormItem/FormFields" arguments="{salutationValues:salutationValues}" />
<f:form.submit value="Create new" />
</f:form>
</f:section>
Die Fehlermeldung
An error occurred while trying to call Tx_MyContactform_Controller_ContactFormItemController->submitFormAction()
kommt aus <f:flashMessages />. Wenn ich das einfach weglasse, erhalte ich nur die Validierungsmeldungen aus der Extension.
Aber ich kann das ja nicht einfach weglassen. Die Fehlermeldung muss ja irgendwo generiert werden.
Aber wo?! Und warum?