Project

General

Profile

Actions

Bug #80295

closed

CSH not working with flexform settings.<fieldname>details

Added by Gerald Loß about 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2017-03-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Hello together,

If I define a flexform with fields containing the prefix settings, I'm not able to provide a context sensitive help with details. Showing the description and a alttitle is working fine. When I define a detail with the syntax settings.<fieldname>.details I get the following error message. This error appears if I click on the csh help in the backend, to open the details window.

PHP Warning
Core: Error handler (BE): PHP Warning: array_shift() expects parameter 1 to be array, string given in /usr/src/typo3_src-7.6.16/typo3/sysext/cshmanual/Classes/Controller/HelpController.php line 116

If I define the field without the "settings." prefix with the syntax <fieldname>.details, I get the details properly shown in the csh help. I guess you try to split the fieldname on the dots in the HelpController Class, but don't recognize that we have at least two dots in the name.
If I omit the "settings." prefix in the fieldname of the flexform, I'm not able to read the flexform values in the extbase engine. So I need urgently a solution for this issue.

Thanks in advanced
Gerald


Files

CSH_Error.zip (1.35 KB) CSH_Error.zip example files with a flexform definition and the corrsponding csh language files Gerald Loß, 2017-03-15 23:09
Actions #1

Updated by Jesper Mathiasen over 6 years ago

Can confirm this issue is still present in Typo3 8.7.8 using PHP v. 7.1

It seems to me, that the entire block of code which parses fieldnames containing a "." is not necessary, perpaps a change somewhere else has rendered it useless?

I tried commenting out the entire block shown below in typo3/sysext/cshmanual/Classes/Controller/HelpController.php line 105-125 and that fixes the problem.

Can anyone confirm this?

    /**
     * Show a single manual
     *
     * @param string $table
     * @param string $field
     */
    public function detailAction($table = '', $field = '*')
    {
        if (empty($table)) {
            $this->forward('index');
        }

        $mainKey = $table;
        // $identifierParts = GeneralUtility::trimExplode('.', $field);
        // // The field is the second one
        // if (count($identifierParts) > 1) {
        //     array_shift($field);
        //     // There's at least one extra part
        //     $extraIdentifierInformation = [];
        //     $extraIdentifierInformation[] = array_shift($identifierParts);
        //     // If the ds_pointerField contains a comma, it means the choice of FlexForm DS
        //     // is determined by 2 parameters. In this case we have an extra identifier part
        //     if (strpos($GLOBALS['TCA'][$table]['columns'][$field]['config']['ds_pointerField'], ',') !== false) {
        //         $extraIdentifierInformation[] = array_shift($identifierParts);
        //     }
        //     // The remaining parts make up the FlexForm field name itself (reassembled with dots)
        //     $flexFormField = implode('.', $identifierParts);
        //     // Assemble a different main key and switch field to use FlexForm field name
        //     $mainKey .= '.' . $field;
        //     foreach ($extraIdentifierInformation as $extraKey) {
        //         $mainKey .= '.' . $extraKey;
        //     }
        //     $field = $flexFormField;
        // }

        $this->view->assignMultiple([
            'table' => $table,
            'key' => $mainKey,
            'field' => $field,
            'manuals' => $field === '*' ? $this->tableManualRepository->getTableManual($mainKey) : [$this->tableManualRepository->getSingleManual($mainKey, $field)],
        ]);
    }
Actions #2

Updated by Riccardo De Contardi over 5 years ago

  • Category set to Backend User Interface
Actions #3

Updated by Gerald Loß over 4 years ago

  • TYPO3 Version changed from 7 to 9
  • PHP Version changed from 5.6 to 7.3
  • Complexity set to medium

The issue is still there in Version 9.5
I think it is time to look at that. Any detailed CSH in the whole Typo3 system is not avail since over 2 years.
The hint in the code above is right. To exclude this part of the code would help, but I don't know any side effects because of that.

If you want to reproduce this problem than install the "news" plugin. In the flexform there are two fields with detailed CSH. The first one "What to display" is working, because there is not settings. prefix (switchableControllerActions). The second one "Category mode" is not working, because there is a prefix (settings.categoryConjunction).

thanks in advance
Gerald

Actions #4

Updated by Gerrit Code Review over 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/+/63003

Actions #5

Updated by Stefan Froemken over 4 years ago

Hi Gerald,

thank you for that issue and thank you Jesper for the code.
Sometimes it's better to create a patch for TYPO3 to speed things up.
I have tested your code against tt_content columns, CType FlexForm fields with and without settings.*. All works.
Let's see what Core Team things about it.

Stefan

Actions #6

Updated by Gerrit Code Review about 4 years ago

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

Actions #7

Updated by Stefan Froemken about 4 years ago

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

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF