Skip to content
Snippets Groups Projects
Commit d4b2d215 authored by Steffen Ritter's avatar Steffen Ritter Committed by Wouter Wolters
Browse files

[BUGFIX] Indexer does not update the FileObjects

If the Indexer updates metadata during runtimer (after a file object)
has been created, the file object itself is not updated.

This leads to possible errors with image rendering, if files are to be
shown which have not been indexed before.

Releases: 6.2
Resolves: #53772
Change-Id: I70be5ebefe1e00e903694a576847fa8fba167461
Reviewed-on: https://review.typo3.org/27690
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
parent cac662a2
Branches
Tags
No related merge requests found
......@@ -250,6 +250,22 @@ class File extends AbstractFile {
}
}
/**
* Updates MetaData properties
*
* @internal Do not use outside the FileAbstraction Layer classes
*
* @param array $properties
* @return void
*/
public function _updateMetaDataProperties(array $properties) {
if ($this->metaDataProperties !== NULL) {
$this->metaDataProperties = array_merge($this->metaDataProperties, $properties);
} else {
$this->metaDataProperties = $properties;
}
}
/**
* Returns the names of all properties that have been updated in this record
*
......
......@@ -120,6 +120,7 @@ class Indexer {
foreach ($newMetaData as $data) {
$metaData = array_merge($metaData, $data);
}
$fileObject->_updateMetaDataProperties($metaData);
$this->getMetaDataRepository()->update($fileObject->getUid(), $metaData);
$this->getFileIndexRepository()->updateIndexingTime($fileObject->getUid());
}
......@@ -220,6 +221,7 @@ class Indexer {
$metaData = array();
list($metaData['width'], $metaData['height']) = getimagesize($rawFileLocation);
$this->getMetaDataRepository()->update($fileObject->getUid(), $metaData);
$fileObject->_updateMetaDataProperties($metaData);
}
}
......
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