Actions
Bug #87315
closedTypeError in RecordStateFactory
Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-01-02
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
$this->resolveAspectFieldNames() may return null instead of empty strings, but only strings are accepted in array_map callback function within resolveAspectFieldValues, leading to an TypeError with PHP 7.2.
Stacktrace:
(1/1) TypeError Argument 1 passed to TYPO3\CMS\Core\DataHandling\Model\RecordStateFactory::TYPO3\CMS\Core\DataHandling\Model\{closure}() must be of the type string, null given in /home/daniels/Projects/company/example-project/htdocs/web/typo3/sysext/core/Classes/DataHandling/Model/RecordStateFactory.php line 103 */ protected function resolveAspectFieldValues(array $data): array { return array_map( function (string $aspectFieldName) use ($data) { return (int)($data[$aspectFieldName] ?? 0); }, $this->resolveAspectFieldNames() ); at TYPO3\CMS\Core\DataHandling\Model\RecordStateFactory->TYPO3\CMS\Core\DataHandling\Model\{closure}(null) at array_map(object(Closure), array('workspace' => 't3ver_wsid', 'versionParent' => 't3ver_oid', 'language' => 'sys_language_uid', 'languageParent' => 'l10n_parent', 'languageSource' => null)) in /home/daniels/Projects/company/example-project/htdocs/web/typo3/sysext/core/Classes/DataHandling/Model/RecordStateFactory.php line 106 return array_map( function (string $aspectFieldName) use ($data) { return (int)($data[$aspectFieldName] ?? 0); }, $this->resolveAspectFieldNames() ); } /**
Updated by Georg Ringer over 5 years ago
- Status changed from New to Rejected
closed as duplicate of #86809
Updated by Georg Ringer over 5 years ago
- Is duplicate of Bug #86809: Resolve strict type assertion in RecordStateFactory added
Actions