Project

General

Profile

Actions

Bug #79936

closed

PAGE_TSCONFIG_ID not substituted correctly in wizard_list module

Added by Kevin Ditscheid almost 8 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-02-21
Due date:
% Done:

100%

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

Description

I got an issue with the list wizard. When using ###PAGE_TSCONFIG_ID### as the pid-parameter, the resulting pid will always be 0, because the code in the ListController::main fetches a TSconfig array with dots appended to the fieldname array keys, but checks for the fieldname array key without the dot.
To reproduce this, simply add a field to TCA with the following wizards config:

'wizards' => [
    'list' => array(
            'type' => 'script',
            'title' => '',
            'icon' => 'actions-system-list-open',
            'params' => array(
                    'table' => 'sys_category',
                    'pid' => '###PAGE_TSCONFIG_ID###'
            ),
            'module' => array(
                    'name' => 'wizard_list'
            )
    )
]

I added this wizard to the sys_file_metadata and added pageTS for it like so:
TCEFORM.sys_file_metadata.categories.PAGE_TSCONFIG_ID = 38

TSconfig will result in:
array(
  'sys_file_metadata' => array(
    'categories.' => array(
      'PAGETSCONFIG_ID' => 38
    )
  )
)

Given field parameter will be:
$this->P['field'] = 'categories'

But the check for the pid is done with the following code:
$this->pid = (int)$TSconfig[$this->P['field']][$keyword];

Actions #1

Updated by Oliver Hader over 7 years ago

  • Category changed from DataHandler aka TCEmain to FormEngine aka TCEforms
Actions #2

Updated by Gerrit Code Review almost 4 years ago

  • Status changed from New 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 https://review.typo3.org/c/Packages/TYPO3.CMS/+/67448

Actions #3

Updated by Oliver Bartsch almost 4 years ago

Hi, I had a look into this. Actually the TSconfig is meanwhile returned as array without any dots. Therefore (int)$TSconfig[$this->P['field']][$keyword] would work without problems. However, there are two other problems why the substitution fails:

1. No TSconfig is fetched at all since the provided $table for getTCEFORM_TSconfig() is NULL
2. The field parameter is missing in the request, so $this->P['field'] is also NULL

The referenced patch fixes these two.

Please note, in the meantime FormEngine changed a lot an these settings have to be set in fieldControl now.

'fieldControl' => [
    'addRecord' => [
        'disabled' => false,
        'options' => [
            'pid' => '###PAGE_TSCONFIG_ID###'
        ]
    ],
    'listModule' => [
        'disabled' => false,
        'options' => [
            'pid' => '###PAGE_TSCONFIG_ID###'
        ]
    ],
],
Actions #4

Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67448

Actions #5

Updated by Gerrit Code Review almost 4 years ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67483

Actions #6

Updated by Oliver Bartsch almost 4 years ago

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

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF