Issue Bug Closed

#98516PHP Warning: Undefined array key "foobar" typo3_src-11.5.16/typo3/sysext/core/Classes/Resource/ProcessedFile.php line 491

Ralph Brugger 10/04/22, 08:41 updated 10/05/22, 09:12

Description

PHP Warning: Undefined array key “foobar” typo3_src-11.5.16/typo3/sysext/core/Classes/Resource/ProcessedFile.php line 491

$processedImage->getProperty(‘title’)

typo3_src-11.5.16/typo3/sysext/core/Classes/Resource/ProcessedFile.php

The error happens while “return $this->properties[$key]”

    public function getProperty($key)
    {
        // The uid always (!) has to come from this file and never the original file (see getOriginalFile() to get this)
        if ($this->isUnchanged() && $key !== 'uid') {
            return $this->originalFile->getProperty($key);
        }
        return $this->properties[$key];
    }

Maybe change it into:

    public function getProperty($key)
    {

        // The uid always (!) has to come from this file and never the original file (see getOriginalFile() to get this)
        if ($this->isUnchanged() && $key !== 'uid') {
            return $this->originalFile->getProperty($key);
        }
        if (isset($this->properties[$key]){
            return $this->properties[$key];
        }
        return null;
    }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Oliver Bartsch changed Duplicates #98412 10/05/22, 09:03

  2. Oliver Bartsch commented and changed status New Closed 10/05/22, 09:12

    Hi, thank you for your report. I’m however closing this issue as a duplicate of #98412, which has already been resolved and will be included in the next maintenance release.