Project

General

Profile

Actions

Bug #73574

closed

CSH for FlexForms broken since Version 7.6

Added by Georg Tiefenbrunn almost 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-02-19
Due date:
% Done:

100%

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

Description

CSH files assigned for flexforms by \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr() stopped working with the new BE form rendering in Version 7.6.

Please have a look at line 56 ff. of TYPO3\CMS\Backend\Form\Container\FlexFormNoTabsContainer and line 60 ff. of TYPO3\CMS\Backend\Form\Container\FlexFormTabsContainer.

  56         // Assemble key for loading the correct CSH file
  57         // @todo: what is that good for? That is for the title of single elements ... see FlexFormElementContainer!
  58         $dsPointerFields = GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['ds_pointerField'], true);
  59         $parameterArray['_cshKey'] = $table . '.' . $fieldName;
  60         foreach ($dsPointerFields as $key) {
  61             if ((string)$row[$key] !== '') {
  62                 $parameterArray['_cshKey'] .= '.' . $row[$key];
  63             }
  64         }

@todo: what is that good for? > it "assembles a key for loading the correct CSH file".

The "key" ($parameterArray['_cshKey']) is defined as [table name].[field name].[DS pointer field 1](.[DS pointer field 2]) (see https://buzz.typo3.org/teams/core/article/getting-ready-for-45-changes-in-csh-for-flexforms/).

The right/working key for an EXT:news plugin is tt_content.pi_flexform.news_pi1.list

The values of $row['CType'] and $row['list_type'] (and some other fields like colPos, header_layout, recursive, l18n_parent) are stored as arrays with key 0.
An Example $row for an EXT:news plugin:

CType => array(1 item)
   0 => 'list' (4 chars)
list_type => array(1 item)
   0 => 'news_pi1' (8 chars)

As a consequence $parameterArray['_cshKey'] is set as tt_content.pi_flexform.Array or tt_content.pi_flexform.Array.Array and thus no csh is rendered for formlabels in flexforms.

I've no idea why some field values are stored as array and other are not (e.g. tt_content.header and tt_content.CType are both of type varchar(255) DEFAULT '' NOT NULL). If that's OK, both classes mentioned above shouldn't simply cast $row[$key] as a string but must use is_string($row[$key]) && $row[$key] !== '' and is_array($row[$key]) && isset($row[$key][0]) && is_string($row[$key]).

System environment: PHP 5.5.9-1ubuntu4.14 / mysql 5.5.46 / TYPO3 CMS 7.6 (composer)

Actions #1

Updated by Georg Tiefenbrunn over 8 years ago

This bug is also/still present in current master (8.x-dev).

Actions #2

Updated by Gisèle Wendl over 8 years ago

I confirm this bug, many thanks for report, it saved hours of research.
Proposition: Must Have.

Actions #3

Updated by Gerrit Code Review over 8 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/48383

Actions #4

Updated by Gerrit Code Review over 8 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/48383

Actions #5

Updated by Gerrit Code Review over 8 years ago

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

Actions #6

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48444

Actions #7

Updated by Wouter Wolters over 8 years ago

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

Updated by Georg Tiefenbrunn over 8 years ago

ThX for fixing!

Actions #9

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF