Project

General

Profile

Actions

Bug #30354

closed

FlexForm select fields can't replace makers in their foreign_table_where clause

Added by Stephen Bungert over 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-09-27
Due date:
% Done:

0%

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

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

class.tx_sbportfolio_ffcategories.zip (1.72 KB) class.tx_sbportfolio_ffcategories.zip itemsProcFunc to fix problem Stephen Bungert, 2011-09-27 15:03
ffbug01.png (43.3 KB) ffbug01.png Stephen Bungert, 2011-09-30 22:58
ffbug02.png (42.6 KB) ffbug02.png Stephen Bungert, 2011-09-30 22:58
ffbug03.png (22.4 KB) ffbug03.png Stephen Bungert, 2011-09-30 22:58

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #50785: FlexForm does not substitute markers in foreign_table_whereClosed2013-08-05

Actions
Related to TYPO3 Core - Bug #16392: Page-TSconfig ###PAGE_TSCONFIG_STR### not evaluated correctly in BackendClosed2006-07-21

Actions
Actions

Also available in: Atom PDF