Bug #29461
closedPage TSconfig for Extbase flexform values doesn't work
100%
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¶
- 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.
- 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
Updated by Gerrit Code Review almost 13 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review almost 13 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review over 12 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review over 12 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 10 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 11 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review about 12 years ago
Patch set 12 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review almost 12 years ago
Patch set 13 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review almost 12 years ago
Patch set 14 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review almost 12 years ago
Patch set 15 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review almost 12 years ago
Patch set 16 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review almost 12 years ago
Patch set 17 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7711
Updated by Gerrit Code Review over 11 years ago
Patch set 18 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/7711
Updated by Kai Vogel over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c9dbea155f3793f7f39d41b5f2bcd92f04443075.
Updated by Christian Kuhn over 11 years ago
- Status changed from Resolved to New
Had to be reverted again, see my before and after screenshots ... I could send the TS if needed.
Updated by Christian Kuhn over 11 years ago
- File before.png before.png added
- File after.png after.png added
Updated by Gerrit Code Review over 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 11 years ago
Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Alexander Stehlik over 11 years ago
Since I found this issue too late I developed a simpler approach:
I allow the escaping of dots in TypoScript keys:
my\.escapted\.key = test
It is much easier to realize and maybe has less side effects? The required patch is attached.
Updated by Josef F. Glatz (Old User) over 11 years ago
I think that this function is very important for editors (back-end usability). Any news when this will be fixed?
Updated by Gerrit Code Review about 11 years ago
Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Artus Kolanowski about 11 years ago
I also think that this function is very important for editors. How safe is it, that this is done in 6.2 LTS?
Updated by Artus Kolanowski about 11 years ago
Alexander Stehlik wrote:
Since I found this issue too late I developed a simpler approach:
I allow the escaping of dots in TypoScript keys:
[...]
It is much easier to realize and maybe has less side effects? The required patch is attached.
I've tried your patch with an extension but no success:
TCEFORM.tt_content.pi_flexform.extension_pi1.sDEF.settings\.flexform\.foo\.bar.disabled = 1
Any Idea why?
Updated by Alexander Stehlik about 11 years ago
Hmm, this is strange.
I'm heavily using this setting in a project and it works without problems. Did you use the patch from the review system? The latest patch is containing my version and should work in TYPO3 6.2.
This is an example Page TSConfig configuration I'm using for the news Extension:
TCEFORM { tt_content { pi_flexform { news_pi1 { sDEF { settings\.orderBy.disabled = 1 } } } } }
The attached screenshot shows how the Info module in the Backend should display the Page TSConfig (with the dot inside the key):
I hope this helps. Otherwise I would need some more information (e.g. some real example code that you are using).
Updated by Gerrit Code Review almost 11 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review almost 11 years ago
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Lorenz Ulrich almost 11 years ago
See my comment in Gerrit concerning Artus' problem I ran into, too.
Updated by Gerrit Code Review almost 11 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Alexander Stehlik almost 11 years ago
@Artus: sorry, it seems that the mixed key with escaped and unescaped dots was the problem. I didn't get that. The new patch should fix that issue.
@Lorenz: Thank you for the clarification :)
Updated by Alexander Stehlik over 10 years ago
Thank you all for your feedback (in the review system). I'm answering here because of the better formatting possibilities :)
Of course escaping Backslashes should be possible. The question is: Do we only handle escaped backslashes in front of dots? This would be a bit inconsistent but less code needs to be changed on the user's / integrator's side. E.g. this code works with the current version:
plugin.tx_myext.persistence.classes { Tx\MyExt\Domain\Model\Mymodel { ... } }
What would happen with the above code? Are the slashes just stripped out because they are not escaped? Or do we leave them untouched (which I would prefer).
The easiest approach would be to just modify two backslashes in front of a dot:
my\.escaped\.key = string
results in
my.escaped.key = string
my\\.escaped\\.key = string
results in
my\ { escaped\ { key { ... } } }
but
My\Slashed\Key = string
will stay as it is:
My\Slashed\Key = string
Would be great to get some thoughts on this.
Updated by Markus Klein over 10 years ago
- Is Regression set to No
Full Ack! +1
Exactly what I thought. To keep necessary changes as low as possible, only touch backslashes before dots.
To which documentation do he have to add that? Inside TYPO3, TSref??
Updated by Alexander Stehlik over 10 years ago
OK, thank you :) I'll look into it.
What about TypoScript Syntax and In-depth Study for the documentation?
Updated by Gerrit Code Review over 10 years ago
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 10 years ago
Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 10 years ago
Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 10 years ago
Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 10 years ago
Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Michiel Roos over 10 years ago
Wow, great news!
This patch actually reduces memory usage!
The rest looks pretty grim though.
Updated by Gerrit Code Review over 10 years ago
Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Michiel Roos over 10 years ago
Updated by Gerrit Code Review over 10 years ago
Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Michiel Roos over 10 years ago
Updated by Gerrit Code Review over 10 years ago
Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 10 years ago
Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Gerrit Code Review over 10 years ago
Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/19480
Updated by Markus Klein over 10 years ago
- Status changed from Under Review to Resolved
Applied in changeset 97bb0574d2484f63208be3dfdeaa78c2ac7e14d6.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed
Updated by Georg Ringer about 6 years ago
- Related to Bug #82372: addItems to flexforms does not work in TYPO3 v8 added