Bug #30354
closedFlexForm select fields can't replace makers in their foreign_table_where clause
0%
Description
FlexForm select fields can't replace makers (like ###PAGE_TSCONFIG_IDLIST###) in their foreign_table_where clause in the left hand part of the input because the $field argument in selectAddForeign() is empty.
The righthand side part of the select field (taht lists all records) can convert these in to the correct values, the records are selectable and their uids are saved in the flexform in the tt_content record, but they are not shown in the left hand side where the actual selected records are shown.
Here is the flexform ds for my select field:
<category> <TCEforms> <label>LLL:EXT:sb_portfolio/pi1/flexform_locallang.xml:itemSelection.category</label> <config> <type>select</type> <items type="array"> <numIndex index="0" type="array"> <numIndex index="0">LLL:EXT:sb_portfolio/pi1/flexform_locallang.xml:itemSelection.category.0</numIndex> <numIndex index="1">-1</numIndex> </numIndex> <numIndex index="1" type="array"> <numIndex index="0">LLL:EXT:sb_portfolio/pi1/flexform_locallang.xml:itemSelection.category.1</numIndex> <numIndex index="1">--div--</numIndex> </numIndex> </items> <exclusiveKeys>-1</exclusiveKeys> <foreign_table_where> AND tx_sbportfolio_categories.pid IN (###STORAGE_PID###, ###PAGE_TSCONFIG_IDLIST###) AND (tx_sbportfolio_categories.sys_language_uid=0 || (tx_sbportfolio_categories.sys_language_uid>0 AND tx_sbportfolio_categories.l10n_parent=0)) ORDER BY tx_sbportfolio_categories.title ASC</foreign_table_where> <foreign_table>tx_sbportfolio_categories</foreign_table> <size>6</size> <autoSizeMax>12</autoSizeMax> <minitems>0</minitems> <maxitems>500</maxitems> </config> </TCEforms> </category>
i have solved it useing an itemsProcFunc that works just on the left hand part of the select field, but I believe this is a bug. If the righthand record list is able to convert these markers, and they are selectable, and saved in the DB, the the left part of the select field should be capable os shwoing them too. they are after all selected.
Without $field being set to 'pi_flexform' it can't as the field is needed in the function exec_foreign_table_where_query().
An example:
$fTWHERE = str_replace('###PAGE_TSCONFIG_IDLIST###', $GLOBALS['TYPO3_DB']->cleanIntList($TSconfig[$field]['PAGE_TSCONFIG_IDLIST']), $fTWHERE);
Files