Commit 37a3d6a3 authored by Daniel Siepmann's avatar Daniel Siepmann Committed by Christian Kuhn
Browse files

[BUGFIX] Update missing file properties

Do not expect all properties to already exist.
Update properties with different value as well as missing properties.

This check also prevents PHP 8.x warnings due to accessing unavailable
array keys.

Resolves: #98387
Releases: main, 11.5
Change-Id: I9c907174acd79ebf6623ffeecbee2f9da3ae463d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75799


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent f2981575
......@@ -181,7 +181,7 @@ class File extends AbstractFile
unset($properties['uid']);
}
foreach ($properties as $key => $value) {
if ($this->properties[$key] !== $value) {
if (!isset($this->properties[$key]) || $this->properties[$key] !== $value) {
if (!in_array($key, $this->updatedProperties)) {
$this->updatedProperties[] = $key;
}
......
Supports Markdown
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