Skip to content
Snippets Groups Projects
Commit 38f484e0 authored by Markus Klein's avatar Markus Klein
Browse files

[BUGFIX] FAL: Prevent invalid NULL value on metadata creation

The cruser_id field is now guaranteed to be an integer.
This patch checks if a BE_USER is available and uses zero
otherwise.

Resolves: #57495
Related: #46020
Releases: 6.2
Change-Id: I8260604eb30ca32d2a5e079fa6f5b10a6d04714e
Reviewed-on: https://review.typo3.org/29028
Reviewed-by: Nicole Cordes
Reviewed-by: Jigal van Hemert
Reviewed-by: Frans Saris
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Markus Klein
Tested-by: Markus Klein
parent d40ef865
No related merge requests found
......@@ -115,7 +115,7 @@ class MetaDataRepository implements SingletonInterface {
'pid' => 0,
'crdate' => $GLOBALS['EXEC_TIME'],
'tstamp' => $GLOBALS['EXEC_TIME'],
'cruser_id' => TYPO3_MODE == 'BE' ? $GLOBALS['BE_USER']->user['uid'] : 0
'cruser_id' => isset($GLOBALS['BE_USER']->user['uid']) ? (int)$GLOBALS['BE_USER']->user['uid'] : 0
);
$emptyRecord = array_merge($emptyRecord, $additionalFields);
$this->getDatabaseConnection()->exec_INSERTquery($this->tableName, $emptyRecord);
......
......@@ -136,7 +136,7 @@ class IndexerService implements \TYPO3\CMS\Core\SingletonInterface {
'crdate' => $GLOBALS['EXEC_TIME'],
'tstamp' => $GLOBALS['EXEC_TIME']
);
if (TYPO3_MODE === 'BE') {
if (isset($GLOBALS['BE_USER']->user['uid'])) {
$additionalInfo['cruser_id'] = (int)$GLOBALS['BE_USER']->user['uid'];
}
$indexRecord = array_merge($fileInfo, $additionalInfo);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment