Bug #69376
closed
EXT:form - OPTGROUP cannot be a child element of SELECT
Added by Björn Jacob almost 9 years ago.
Updated almost 7 years ago.
Description
The following code produces an PHP fatal error:
10 = SELECT
10 {
label = Select
10 = OPTGROUP
10 {
label = Optgroup
10 = OPTION
10 {
data = Option 1
value = value 1
}
20 = OPTION
20 {
data = Option 2
value = value 2
}
}
}
The code mentioned above should be possible, see documentation.
The following error occurs:
#1: PHP Catchable Fatal Error: Argument 1 passed to
TYPO3\CMS\Form\Domain\Model\Element\SelectElement::addElement()
must be an instance of TYPO3\CMS\Form\Domain\Model\Element\OptionElement,
instance of TYPO3\CMS\Form\Domain\Model\Element\OptgroupElement given, called in
/typo3/cms/typo3/sysext/form/Classes/Domain/Factory/TypoScriptFactory.php on line 165
and defined in
/typo3/cms/typo3/sysext/form/Classes/Domain/Model/Element/SelectElement.php line 56
- Description updated (diff)
- Subject changed from Forms: OPTGROUP cannot be an child element of SELECT to Forms: OPTGROUP cannot be a child element of SELECt
- Subject changed from Forms: OPTGROUP cannot be a child element of SELECt to Forms: OPTGROUP cannot be a child element of SELECT
- Status changed from New to On Hold
On hold since we're working on the new fluid FE rendering, see #69401.
- Subject changed from Forms: OPTGROUP cannot be a child element of SELECT to EXT:form - OPTGROUP cannot be a child element of SELECT
- Status changed from On Hold to Needs Feedback
- Assignee set to Ralf Zimmermann
This ist fixed in version 7.5. Is there any chance of fixing this for 6? At least try to avoid the PHP error.
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43477
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43477
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43492
- Target version set to 6.2.16
- TYPO3 Version changed from 7 to 6.2
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43492
Test form:
prefix = tx_form
confirmation = 1
postProcessor {
1 = mail
1 {
recipientEmail = your@mail.com
senderEmail = your@mail.com
}
}
10 = TEXTLINE
10 {
name = birth
label {
value = Date of birth
}
}
20 = SELECT
20 {
label = Select
name = select1
10 = OPTGROUP
10 {
label = Optgroup
10 = OPTION
10 {
data = Option 1
value = value 1
}
20 = OPTION
20 {
data = Option 2
value = value 2
}
}
}
30 = SUBMIT
30 {
name = submit
value = Submit
}
rules {
1 = date
1 {
breakOnError = 0
showMessage = 1
message = (%format)
error = No date!
format = %e-%m-%Y
element = birth
}
}
This is another Bug(?).
Please give the Select Element a "name" propery. Now it works.
The same goes for the TEXTLINE element. Remove "name = birth" and the confirmation page will stay empty.
But this is a new issue and not related to the current issue.
You are right. I have changed the example form above. Now it works like a charm.
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF