[TYPO3-english] Re: any working form for 6.2.2?

Torsten Crass torsten.crass at ebiology.de
Fri May 16 13:17:38 CEST 2014


Hi,

just installed the "form" core extension in 6.2.2, built a very simple mail form just containing a text field and a submit button, hit the button, and -- bang!

[pre]
Uncaught TYPO3 Exception
#1: PHP Warning: Invalid argument supplied for foreach() in /PATH/TO/MY/typo3/typo3_src-6.2.2/typo3/sysext/form/Classes/Utility/ValidatorUtility.php line 125 (More information)

TYPO3\CMS\Core\Error\Exception thrown in file
/PATH/TO/MY/typo3/typo3_src-6.2.2/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 111.

13 TYPO3\CMS\Core\Error\ErrorHandler::handleError(2, "Invalid argument supplied for foreach()", "/PATH/TO/MY/typo3/typo3_src-6....3/sysext/form/Classes/Utility/ValidatorUtility.php", 125, array)

/PATH/TO/MY/typo3_src-6.2.2/typo3/sysext/form/Classes/Utility/ValidatorUtility.php:
00123:   $this->errors[$prefix] = array();
00124:   $result = TRUE;
00125:   foreach ($this->rules[$prefix] as $key => $element) {  <=====
00126:    $rule = $element['instance'];
00127:    $fieldName = $element['fieldName'];

12 TYPO3\CMS\Form\Utility\ValidatorUtility::isValid()

/PATH/TO/MY/typo3/typo3_src-6.2.2/typo3/sysext/form/Classes/Controller/FormController.php:
00153:   if (
00154:    $submittedByPrefix === NULL ||
00155:    !empty($submittedByPrefix) && !$this->validate->isValid() ||  <=====
00156:    !empty($submittedByPrefix) && $this->validate->isValid() &&
00157:    $this->requestHandler->getPost('confirmation-false', NULL) !== NULL

11 TYPO3\CMS\Form\Controller\FormController::showForm()
..
[/pre]

Removed and re-installed the extension, deleted and re-built the form, build a similar form in a different page -- always the same resutl.

I manually placed some var_dump commands around the highlighted code lines -- $submittedByPrefix does contain the correct values, but the validate->rules array is empty, resulting to NULL being passed to the foreach loop.

I have another Typo3 (Version 6.1) installation running whose form extension works fine. So I suspect there must be a problem with the form sysext in 6.2.(2.)...

Any ideas appreciated!

(For reference: Here's the typoscript for my mail form:
[pre]
enctype = multipart/form-data
method = post
prefix = tx_form
confirmation = 
postProcessor {
	1 = mail
	1 {
		recipientEmail = my (at) email.adress
		senderEmail = sender (at) email.address
		subject = Test mail
	}
}
10 = TEXTLINE
10 {
	name = name
	label {
		value = Name
	}
}
20 = SUBMIT
20 {
	name = 3
	value = Submit form
}

[/pre]
)


Best regards --

Torsten


More information about the TYPO3-english mailing list