Project

General

Profile

Actions

Bug #29461

closed

Page TSconfig for Extbase flexform values doesn't work

Added by Egbert van der Hout about 13 years ago. Updated about 7 years ago.

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

100%

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

Description

Description

Works

TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.title = New title
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.disabled = 1
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.label = New label
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.removeItems = Object->View

Doesn't work due to removeDotsFromTS in modifyFlexFormDS (t3lib/tceforms/class.t3lib_tceforms_flexforms.php)

TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.settings.firstsetting.label = New label

Doesn't work due to violation of TS-syntax (duh ;))

TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.addItems.Object->action = Actionname

Problems

  1. Due to the removal of dots in TSconfig Extbase FF-fields (which normally use the format settings.settingsname) those fields cannot be overriden with (Page) TSconfig.
  2. Due to the format of the value field of switchableControllerActions-items (Object->action) no items can be added

Possible solution

Problem 1 (hackish, I know)

- Use special format in TSconfig (_settings_ in stead of settings.):

TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF._settings_firstsetting.label = New label
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF._settings_firstsetting.removeItems = itemvalueA

- Add this code in t3lib/tceforms/class.t3lib_tceforms_flexforms.php, line 95+ (just after $sheetConf = t3lib_div::removeDotsFromTS(...);)
    // Replace _settings_ by settings. for Extbase Flexforms
    foreach($sheetConf as $sheetName => $sheetArray) {
        foreach($sheetArray as $fieldName => $fieldArray) {
            if (t3lib_div::isFirstPartOfStr($fieldName, '_settings_')) {
                $newFieldName = str_replace('_settings_', 'settings.', $fieldName);
                $sheetConf[$sheetName][$newFieldName] = $fieldArray;
                unset($sheetConf[$sheetName][$fieldName]);
            }
        }
    }

Problem 2 (hackish too)

- Use special format in TSconfig (_Object_Action in stead of Object->):

TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.addItems._Object_action = Actionname

- Extend the code of solution 1 to ...
    // Replace _settings_ by settings. for Extbase Flexforms
    foreach($sheetConf as $sheetName => $sheetArray) {
        foreach($sheetArray as $fieldName => $fieldArray) {
            if (t3lib_div::isFirstPartOfStr($fieldName, '_settings_')) {
                $newFieldName = str_replace('_settings_', 'settings.', $fieldName);
                $sheetConf[$sheetName][$newFieldName] = $fieldArray;
                unset($sheetConf[$sheetName][$fieldName]);
            } else if ($fieldName === 'switchableControllerActions' && array_key_exists('addItems', $fieldArray)) {
                foreach($fieldArray['addItems'] as $addItemValue => $addItemLabel) {
                    $newAddItemValue = preg_replace('/\_([^\_]*)\_(.*)/', '$1->$2', $addItemValue);
                    $sheetConf[$sheetName][$fieldName]['addItems'][$newAddItemValue] = $addItemLabel;
                    unset($sheetConf[$sheetName][$fieldName]['addItems'][$addItemValue]);
                }
            }
        }
    }

Conclusion

I guess the Extbase FF overrides in TSconfig needs some more thinking to solve permanently.


Files

before.png (62 KB) before.png Christian Kuhn, 2013-03-25 21:47
after.png (13.4 KB) after.png Christian Kuhn, 2013-03-25 21:47
typo3-29461-escape_typoscript_key.diff (6.25 KB) typo3-29461-escape_typoscript_key.diff Alexander Stehlik, 2013-07-24 16:35
screenshot_info_tsconfig.png (4.33 KB) screenshot_info_tsconfig.png Alexander Stehlik, 2013-11-11 22:36
Screen_Shot_2014-02-24_at_22.50.28.png (32.7 KB) Screen_Shot_2014-02-24_at_22.50.28.png Before and After Michiel Roos, 2014-02-24 22:51
Screen_Shot_2014-02-24_at_23.36.49.png (32.9 KB) Screen_Shot_2014-02-24_at_23.36.49.png Before and After patch set 13 Michiel Roos, 2014-02-24 23:37
Screen_Shot_2014-02-25_at_08.34.29.png (32.1 KB) Screen_Shot_2014-02-25_at_08.34.29.png Before & After patch set 20 Michiel Roos, 2014-02-25 08:35

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #82372: addItems to flexforms does not work in TYPO3 v8Rejected2017-09-08

Actions
Has duplicate TYPO3 Core - Feature #50389: Allow escaping of TypoScript keysClosed2013-07-24

Actions
Actions

Also available in: Atom PDF