[BUGFIX] Resolve strict type assertion in RecordStateFactory 07/58807/2
authorOliver Hader <oliver@typo3.org>
Wed, 31 Oct 2018 06:44:37 +0000 (07:44 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 31 Oct 2018 08:16:26 +0000 (09:16 +0100)
Applying a strict "string" type to values that are "null" will
lead to type errors for TCA properties that are not configured
- most probably for "languageField", "transOrigPointerField"
or "translationSource".

see https://github.com/georgringer/news/issues/776

Resolves: #86809
Releases: master
Change-Id: I53e9a48f196b8a87c97620346474528a0cf3877e
Reviewed-on: https://review.typo3.org/58807
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/DataHandling/Model/RecordStateFactory.php

index 1d46225..f2906a9 100644 (file)
@@ -100,7 +100,7 @@ class RecordStateFactory
     protected function resolveAspectFieldValues(array $data): array
     {
         return array_map(
-            function (string $aspectFieldName) use ($data) {
+            function ($aspectFieldName) use ($data) {
                 return (int)($data[$aspectFieldName] ?? 0);
             },
             $this->resolveAspectFieldNames()