Bug #79936
closedPAGE_TSCONFIG_ID not substituted correctly in wizard_list module
100%
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];
Updated by Oliver Hader over 7 years ago
- Category changed from DataHandler aka TCEmain to FormEngine aka TCEforms
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
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###'
]
],
],
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
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
Updated by Oliver Bartsch almost 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4b433c03026536cb9e5c7831940cb74901a74a13.