Project

General

Profile

Actions

Bug #70294

closed

Story #46140: Add configurable linkhandler for arbitrary records

additionalGetParameters in PageTS TCEMAIN.preview function does not work with parameter array

Added by Martin R. Krause almost 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend API
Target version:
Start date:
2015-10-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #66370: Add generic preview URL generator APIClosedMarkus Klein2015-04-10

Actions
Actions #1

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.

Actions #2

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
Actions #3

Updated by Markus Klein almost 9 years ago

  • Target version set to 7 LTS
Actions #4

Updated by Markus Klein almost 9 years ago

  • Parent task set to #46140
Actions #5

Updated by Markus Klein almost 9 years ago

  • Category set to Backend API
  • Assignee set to Markus Klein
  • Complexity set to easy
Actions #6

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

Actions #7

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

Actions #8

Updated by Markus Klein almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF