Bug #73076
closed
Publishing of changed sys_file_metadata fails because of missing config array for with and height fields
Added by Andreas Krämer almost 9 years ago.
Updated about 6 years ago.
Description
Hello, I get the following error trying to publish changed metadata from any file:
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/sysext/version/Classes/Hook/DataHandlerHook.php on line 905 and defined in /typo3/sysext/version/Classes/Hook/DataHandlerHook.php line 1048
I looked up the code and for all TCA-fields a config array is expected:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/version/Classes/Hook/DataHandlerHook.php#L907
But there is no config for width and height in sys_file_metadata (without installing the filemetadata plugin):
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Configuration/TCA/sys_file_metadata.php#L126
I think the issue at least exists since version 6.2
Steps to reproduce:
- Change metadata of arbitrary file with a simple editor on draft workspace, e.g. the title
- Go to the workspace module and send the changes to the next stage "ready to publish"
- With an admin, go to the workspace module and try to publish these changes
As far as I can see, the problem was introduced between 6.2.15 and 6.2.17.
In our installation the problem did not occur with 6.2.14
We are experiencing the exact same error with TYPO3 Version 6.2.17.
Operating system: Unix
PHP version: 5.5.32
- Target version set to 7.6.5
Same here, TYPO3 7 LTS (7.6.4). PHP 5.5.9-1ubuntu4.14
router
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 /var/www/TYPO3_7_LTS.CMS.git/typo3/sysext/version/Classes/Hook/DataHandlerHook.php on line 907 and defined in /var/www/TYPO3_7_LTS.CMS.git/typo3/sysext/version/Classes/Hook/DataHandlerHook.php line 1050
I get this Error in log: [newlog()] A swapping lock file was present. Either another swap process is already running or a previous swap process failed. Ask your administrator to handle the situation.
Deleting the swap_locking folder in typo3temp is not resolving this
After seeing this error:
caller => "TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECTquery" (60 chars)
ERROR => "Unknown column 'uid' in 'field list'" (36 chars)
lastBuiltQuery => "SELECT uid FROM tx_realurl_pathcache WHERE 1=1" (46 chars)
debug_backtrace => "call_user_func#27 // {closure}# // TYPO3\CMS\Backend\Console\Application->ru
n#26 // TYPO3\CMS\Core\Core\Bootstrap->handleRequest#73 // TYPO3\CMS\Backend
\Console\CliRequestHandler->handleRequest#302 // call_user_func#69 // TYPO3\
CMS\Core\Cache\Backend\SimpleFileBackend->{closure}# // TYPO3\CMS\Core\Datab
ase\ReferenceIndex->updateIndex#1088 // TYPO3\CMS\Core\Database\DatabaseConn
ection->exec_SELECTquery#1182 // TYPO3\CMS\Core\Database\DatabaseConnection-
>debug#314" (466 chars)
I deinstalled and reinstalled realurl and updated refindex, now it works.
I had this problem on a updated Page 4.5 -> 6.2 -> 7 LTS . OP, Can you try this too?
Thanks for your update and sorry it took me so long to respond!
I just tested it with a clean installation of TYPO3 7.6.5. I configured a draft workspace and did the mentioned "steps to reproduce". The error immediately occured after trying to publish the changed title of my image. realUrl was not installed this time.
If I take a look into the code this can not work with the default TCA configuration of width and height in sys_file_metadata.
I can confirm the issue exists in 7.6.9. Rebuild reference index doesn't help, only the installation of filemetadata solves the problem.
- Target version changed from 7.6.5 to Candidate for patchlevel
Workaround for this bug is to enable filemetadata
extension.
Same problem in 6.2.25 and 6.2.26.
PHP-Log (only with 6.2.25):
PHP Catchable fatal error: Argument 3 passed to TYPO3\CMS\Version\Hook\DataHandlerHook::version_swap_processFields() must be an array, null given, called in /var/lib/typo3/typo3_src-6.2.25/typo3/sysext/version/Classes/Hook/DataHandlerHook.php on line 864 and defined in /var/lib/typo3/typo3_src-6.2.25/typo3/sysext/version/Classes/Hook/DataHandlerHook.php on line 1030
BE-Protocol:
[newlog()] A swapping lock file was present. Either another swap process is already running or a previous swap process failed. Ask your administrator to handle the situation.
Enable filemetadata extension does not resolve the problem for me.
Why does it take so long to decide on the way to go.
Either 'config' is mandatory in the TCA column definition or it is optional.
1) Mandatory use #81811
2) Optional use suggestion #77619
- Status changed from New to Under Review
Hey Michael,
I was not aware of that issue until last night. I have pushed a patch adding the fields for v9, v8 and v7. Please review and test.
For v9, I will add a deprecation that it is not possible to add TCA columns without a config.
- Related to Bug #83152: TCA migration should check that all TCA columns have a config section added
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Related to Bug #83140: Images not shown when metadata is translated added
- Related to Bug #83247: Translating sys_file_metadata results in width 0 and height 0 added
- Status changed from Resolved to Closed
Also available in: Atom
PDF