Issue Bug Closed

#77619Catchable Fatal Error during publishing process

Robert Vock 08/24/16, 14:19 updated 10/02/18, 11:07

Description

When I try to publish a complete workspace, I got the following error:

PHP Catchable Fatal Error: Argument 3 passed to TYPO3\CMS\Version\Hook\DataHandlerHook::version_swap_processFields() must be of the type array, null given,
called in .../typo3_src/typo3/sysext/version/Classes/Hook/DataHandlerHook.php on line 907 and defined in .../typo3_src/typo3/sysext/version/Classes/Hook/DataHandlerHook.php line 1050

This happens because the method TYPO3\CMS\Version\Hook\DataHandlerHook::version_swap_processFields gets called with null instead of an array, if a field in TCA does not have a config-entry.

The core-configuration for sys_file_metadata contains a configuration for width, which does not contain a config-entry.

Relevant code positions:
https://github.com/TYPO3/TYPO3.CMS/blob/e5c510f1069b751053e0056b52ff3a93397ba91f/typo3/sysext/version/Classes/Hook/DataHandlerHook.php#L945
https://github.com/TYPO3/TYPO3.CMS/blob/e5c510f1069b751053e0056b52ff3a93397ba91f/typo3/sysext/core/Configuration/TCA/sys_file_metadata.php#L121

The fix would be to check if $fieldConf[‘config’] exists and is an array in the version_swap-method before calling the version_swap_processFields-method.

Reviews 5