Project

General

Profile

Actions

Bug #88094

closed

Opening inline elements fails

Added by Florian Wessels over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2019-04-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Opening inline elements fails with error `1489751363: Hash does not validate` when sorting of numeric array keys is not ascending.

How to reproduce:

The following TCA is given:

$GLOBALS['TCA']['tx_foo']['columns']['image']['config'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
    'image',
    [
        'overrideChildTca' => [
            'types' => [
                \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                    'showitem' => 'some_fields',
                ],
                \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
                    'showitem' => 'some_fields',
                ],
            ],
        ],
    ],
),

Good to know:
Value of \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE is "2".
Value of \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN is "0"

The JSON the server generates when rendering the inline element is:

{
  "config": {
    "overrideChildTca": {
      "types": {
        "2": {
          "showitem": "some_fields" 
        },
        "0": {
          "showitem": "some_fields" 
        }
      }
    }
  }
}

When you now try to expand the collapsed inline element you will get the error described above.
The Browser (latest Chrome) sends following JSON to the server:

{
  "config": {
    "overrideChildTca": {
      "types": {
        "0": {
          "showitem": "some_fields" 
        }
        "2": {
          "showitem": "some_fields" 
        }
      }
    }
  }
}

Now the ordering of the elements is ascending and the hmac comparison fails.

And yes, the solution is to rearrange the order of the elements in the TCA, but in my opinion that is not the way we should go.


Files

issue88094-fix.diff (3.24 KB) issue88094-fix.diff filigivuji filigivuji, 2019-06-06 23:04

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #91217: hmac-error due to different sorting in configClosed2020-04-28

Actions
Actions

Also available in: Atom PDF