Skip to content
Snippets Groups Projects
Commit eb619ab2 authored by Alexander Stehlik's avatar Alexander Stehlik Committed by Steffen Ritter
Browse files

[BUGFIX] Update file type on mimetype change

If the mime type of a file has changed, the type property of a file
will be updated, too.

Resolves: #54305
Releases: 6.2
Change-Id: I013e2adbbb3d3cd3973ab50c8e88806b9477fe90
Reviewed-on: https://review.typo3.org/26288
Reviewed-by: Markus Klein
Reviewed-by: Marcin Sągol
Reviewed-by: Steffen Ritter
Tested-by: Markus Klein
Tested-by: Steffen Ritter
parent 0bcfd5bb
Branches
Tags
No related merge requests found
......@@ -244,7 +244,12 @@ class File extends AbstractFile {
$this->properties[$key] = $value;
}
}
// If the mime_type property should be updated and it was changed also update the type.
if (array_key_exists('mime_type', $properties) && in_array('mime_type', $this->updatedProperties)) {
$this->updatedProperties[] = 'type';
unset($this->properties['type']);
$this->getType();
}
if (array_key_exists('storage', $properties) && in_array('storage', $this->updatedProperties)) {
$this->storage = ResourceFactory::getInstance()->getStorageObject($properties['storage']);
}
......
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