Skip to content
Snippets Groups Projects
Commit 024bc6cf authored by Steffen Ritter's avatar Steffen Ritter Committed by Andreas Wolf
Browse files

[BUGFIX] IndexerService does not set creating user

When a backenduser uploads a file an index record is
created. The sys_file table ships with the column cruser_id
 which is never been filled because all sys_file records
are created by the IndexerService which does not take care
of that field.

Add this knowledge to the indexer service.

Releases: 6.0, 6.1
Fixes: #46596
Change-Id: I2a82ea5375b892604fc1a27376487bc4efe3a16e
Reviewed-on: https://review.typo3.org/19217
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
parent 96e325cd
Branches
Tags
No related merge requests found
......@@ -122,10 +122,15 @@ class IndexerService implements \TYPO3\CMS\Core\SingletonInterface {
if ($movedFile === FALSE) {
// Crdate and tstamp should not be present when updating
// the file object, as they only relate to the index record
$indexRecord = array_merge($fileInfo, array(
$additionalInfo = array(
'crdate' => $GLOBALS['EXEC_TIME'],
'tstamp' => $GLOBALS['EXEC_TIME']
));
);
if (TYPO3_MODE === 'BE') {
$additionalInfo['cruser_id'] = intval($GLOBALS['BE_USER']->user['uid']);
}
$indexRecord = array_merge($fileInfo, $additionalInfo);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_file', $indexRecord);
$fileInfo['uid'] = $GLOBALS['TYPO3_DB']->sql_insert_id();
}
......
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