Actions
Bug #66581
closedExtbase - JsonView: wrong key encoding in array
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-04-24
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
If the array key is of type string, then the PHP function json_encode converts it to named objects instead of an array.
Extbase internal reference identifiers are encoded of type string instead of integer.
The bug is here in case of '_descendAll' https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/Classes/Mvc/View/JsonView.php#L255
FIX: convert the key to integer
Change from:
$array[$key] = $this->transformValue($element, $configuration['_descendAll']);
to:
$array[hexdec($key)] = $this->transformValue($element, $configuration['_descendAll']);
Actions