Issue Bug Closed

#98993Flexform select with multiple fixed and DB values fails

Bernhard Eckl 11/03/22, 17:05 updated 10/26/23, 13:59

Description

I have a flexform with a select and want to have two options (nothing and all) plus values from the database. If I select the second (fixed value) after saving the first value is selected again. Here is my code:

                    <settings.myfield>
                        <TCEforms>
                            <label>My label</label>
                            <config>
                                <type>select</type>
                                <renderType>selectSingle</renderType>
                                <items>
                                    <numIndex index="0">
                                        <numIndex index="0">---</numIndex>
                                        <numIndex index="1"></numIndex>
                                    </numIndex>
                                    <numIndex index="1">
                                        <numIndex index="0">Alle</numIndex>
                                        <numIndex index="1">all</numIndex>
                                    </numIndex>
                                </items>
                                <foreign_table>tablename</foreign_table>
                                <foreign_table_where>
                                ...
                                </foreign_table_where>
                            </config>
                        </TCEforms>
                    </settings.myfield>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Rico Drexler commented 07/21/23, 07:55

    This is probably not a bug. With foreign_table you can only store INT values, unless you set the value allowNonIdValues to true.

    Look here:
    https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/selectSingle.html#allownonidvalues

  2. Christian Kuhn commented and changed status New Closed 10/26/23, 13:59

    Thanks for the comment, Rico.

    I did not actively test this, but it sounds as if you’re correct with your assessment.

    Since this issue did not gain much traction, I hope it’s ok to close here for now.

    Please re-open or create a new issue in case we missed something.