Issue Bug Closed

#69376EXT:form - OPTGROUP cannot be a child element of SELECT

Björn Jacob 08/27/15, 21:42 updated 10/23/17, 21:49

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

Reviews 2