Project

General

Profile

Actions

Bug #87315

closed

TypeError in RecordStateFactory

Added by Daniel Siepmann over 5 years ago. Updated over 5 years ago.

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()
        );
    }

    /**


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #86809: Resolve strict type assertion in RecordStateFactoryClosed2018-10-31

Actions
Actions #1

Updated by Georg Ringer over 5 years ago

  • Status changed from New to Rejected

closed as duplicate of #86809

Actions #2

Updated by Georg Ringer over 5 years ago

  • Is duplicate of Bug #86809: Resolve strict type assertion in RecordStateFactory added
Actions

Also available in: Atom PDF