Project

General

Profile

Actions

Bug #69376

closed

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

Added by Björn Jacob about 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
Start date:
2015-08-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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
Actions #1

Updated by Björn Jacob about 9 years ago

  • Description updated (diff)
Actions #2

Updated by Björn Jacob about 9 years ago

  • Subject changed from Forms: OPTGROUP cannot be an child element of SELECT to Forms: OPTGROUP cannot be a child element of SELECt
Actions #3

Updated by Björn Jacob about 9 years ago

  • Subject changed from Forms: OPTGROUP cannot be a child element of SELECt to Forms: OPTGROUP cannot be a child element of SELECT
Actions #4

Updated by Björn Jacob about 9 years ago

  • Status changed from New to On Hold

On hold since we're working on the new fluid FE rendering, see #69401.

Actions #5

Updated by Björn Jacob about 9 years ago

  • 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.

Actions #6

Updated by Gerrit Code Review about 9 years ago

  • 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

Actions #7

Updated by Gerrit Code Review about 9 years ago

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

Actions #8

Updated by Gerrit Code Review about 9 years ago

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

Actions #9

Updated by Björn Jacob about 9 years ago

  • Target version set to 6.2.16
  • TYPO3 Version changed from 7 to 6.2
Actions #10

Updated by Gerrit Code Review about 9 years ago

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

Actions #11

Updated by Björn Jacob about 9 years ago

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
    }
}

Actions #12

Updated by Ralf Zimmermann almost 9 years ago

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.

Actions #13

Updated by Björn Jacob almost 9 years ago

You are right. I have changed the example form above. Now it works like a charm.

Actions #14

Updated by Ralf Zimmermann almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF