Bug #88094
closedOpening inline elements fails
100%
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