Annotation is missing on re-displaying
At first, thanks for releasing powermail for TYPO3 13!
We have installed this extension in a TYPO3 13.4.15 system. After sending a mail (receiver and sender gets the message), a lot of error message get in error log with following message:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1217839467: Could not ultimately dispatch the request after 101 iterations. Most probably, a @TYPO3\CMS\Extbase\Annotation\IgnoreValidation annotation is missing on re-displaying a form with validation errors.
This form does not use captcha or other custom validations. Only fields for name, mail, subject, textarea.
I have try to debugging this error and added a annotations in two ways in createAction-Function in FormController.php:
@TYPO3\CMS\Extbase\Annotation\IgnoreValidation("mail") #[ExtbaseAnnotation\IgnoreValidation(["mail"])]
This error comes every second and caused a server crash.
+1
+1
+1
I encountered the same issue in TYPO3 V13.4.17.
I don't know if that helps anyone but i had the same exception after an update to TYPO3 13.4.17. I had a modified template where the fluid form had the parameter additionalAttributes="{vh:validation.enableParsleyAndAjax(form:form)}"
after i changed that to additionalAttributes="{vh:validation.enableJavascriptValidationAndAjax(form:form)}" (like in the default template), the exceptions disappeared.
+1
For me it was this line in the Templates/Form/Form.html Template:
I had this line:
<f:form.hidden name="mail[form]" value="{form.uid}" class="powermail_form_uid"/>
and changed it to this line like in the original Template:
<f:form.hidden name="mail[form]" value="{form.uid}" class="powermail_form_uid" respectSubmittedDataValue="false" />
(Update from older Version to TYPO3 13.4.18)
UPDATE: We have one installation where we only use the original templates and there we also got the message 101 iterations message... So maybe the problem is not in the templates?
I am using typo3 13.4.8 and powermail 13.0.1 After sending a mail (receiver and sender gets the message), a lot of error message get in error log with following message: Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1217839467: Could not ultimately dispatch the request after 101 iterations. Most probably, a @TYPO3\CMS\Extbase\Annotation\IgnoreValidation annotation is missing on re-displaying a form with validation errors. | TYPO3\CMS\Extbase\Mvc\Exception\InfiniteLoopException thrown in file
We only use the original templates and there we also got the message 101 iterations message
Maybe in relation to https://github.com/in2code-de/powermail/issues/1293?
+1
Issue
The error occurs due to a missing setRequest call in
In2code\Powermail\Utility\TemplateUtility::getDefaultStandAloneView().
Without the current request context, Extbase cannot properly handle re-displayed forms with validation errors, leading to the following error:
(1/1) #1217839467 TYPO3\CMS\Extbase\Mvc\Exception\InfiniteLoopException
Could not ultimately dispatch the request after 101 iterations. Most probably, a @TYPO3\CMS\Extbase\Annotation\IgnoreValidation annotation is missing on re-displaying a form with validation errors.
Corrected method
/**
* Get a default Standalone view
*/
public static function getDefaultStandAloneView(
string $format = 'html'
): StandaloneView {
/** @var StandaloneView $standaloneView */
$standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
$standaloneView->setRequest($GLOBALS['TYPO3_REQUEST']); // Add this line
$standaloneView->setFormat($format);
$standaloneView->setLayoutRootPaths(self::getTemplateFolders('layout'));
$standaloneView->setPartialRootPaths(self::getTemplateFolders('partial'));
return $standaloneView;
}
Explanation
Adding the current TYPO3 request ensures the StandaloneView is initialized with the correct runtime context. This prevents Extbase from falling into an infinite dispatch loop when re-rendering forms after validation errors.
@Zellwerker That doesn't seem to solve the problem, at least not for me and TYPO3 13.4.21 & powermail 13.0.4.
At least not on its own.
@Teisi
Are you overriding the Powermail templates?
If yes, I’d strongly recommend temporarily resetting everything to the default Powermail templates, partials and layouts.
In my case the issue was caused by a bug in a custom partial:
Partials/Form/Field/Check.html
There was a trailing dot in the attribute
property="{field.marker}."
which caused the problem. I honestly don’t remember where that dot came from — most likely a leftover from older Powermail versions.
If the original Powermail templates work correctly, you’ll know exactly where to look.
One more note: even without template overrides, the fix described in my previous post is still required.
With TYPO3 13.4.22 and Powermail 13.0.4, it does not work for me either without the TemplateUtility override — even when using corrected templates.
Good luck with debugging!
+1
Patch works for me.
Thank you @Zellwerker !
Well, I have tried all your suggestions, but I still get this error message on the initial page (not after submitting the form), but only when I use a custom spamshield method in my form like described here: https://docs.typo3.org/p/in2code/powermail/13.0/en-us/ForDevelopers/AddSpamshieldMethods.html That means: the example from the above page does not work for me. Can anyone test that example?
OK, I solved my problem from above. The reason was that the partial was not found.