Bug #70294
closedStory #46140: Add configurable linkhandler for arbitrary records
additionalGetParameters in PageTS TCEMAIN.preview function does not work with parameter array
100%
Description
The PageTS function TCEMAIN.preview allow preview link configuration for arbitrary tables (which is very cool).
Regarding to web/typo3/sysext/core/Documentation/Changelog/7.2/Feature-66370-AddFlexiblePreviewUrlConfiguration.rst the configuration
additionalGetParameters { tx_myext_pi1[special] = HELLO }
should allow to set extra parameter (e.g. the controller action). This only works for parameter names without subarray (e.g. key=value), multi-dimensional parameters do not work (e.g. tx_ext_aaa[action]=show). The reason is that the TS parser eliminates all keys with "[" or "]“, the resulting TS array is empty.
Writing this parameters wit TS array, like
additionalGetParameters { tx_myext_pi1 { special = HELLO } }
does not work either, because the key will become "tx_myext_pi1." with a dot.
The feature in question can fe found here: web/typo3/sysext/backend/Classes/Controller/EditDocumentController.php:743
Possible solution: Revers parameter key and values like this:¶
additionalGetParameters { tx_myext_pi1 { HALLO = special[subkey] } }
Looks stupid, but the field to parameter mapping configuration in the same feature, that will always be written right above the additionalGetParameters configuration uses the same order. So in practice it would feel natural to the developer.
Updated by Jacob Dreesen almost 9 years ago
I just stumbled about this bug, too.
Martin R. Krause wrote:
Possible solution: Revers parameter key and values like this:¶
additionalGetParameters { tx_myext_pi1 { HALLO = special[subkey] } }Looks stupid, but the field to parameter mapping configuration in the same feature, that will always be written right above the additionalGetParameters configuration uses the same order. So in practice it would feel natural to the developer.
The problem I see with this solution is that parameter names are unique but their values are not necessarily unique, which means you cannot use them as array keys because they would overwrite each other. This works for fieldToParameterMap
because field names are unique.
Updated by Georg Ringer almost 9 years ago
- Status changed from New to Accepted
- Is Regression changed from No to Yes
- Sprint Focus set to Stabilization Sprint
Updated by Markus Klein almost 9 years ago
- Category set to Backend API
- Assignee set to Markus Klein
- Complexity set to easy
Updated by Gerrit Code Review almost 9 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43911
Updated by Gerrit Code Review almost 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43911
Updated by Markus Klein almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 18dd60f9c6a2dc4007c8aff922073019c8540d0a.
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Resolved to Closed