Issue Bug Closed

#79936PAGE_TSCONFIG_ID not substituted correctly in wizard_list module

Kevin Ditscheid 02/21/17, 11:55 updated 02/23/21, 13:13

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];

Reviews 2