Project

General

Profile

Actions

Bug #98516

closed

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

Added by Ralph Brugger about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2022-10-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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;
    }

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #98412: PHP Warning: Undefined array key "xyz" in ProcessedFileClosedDaniel Siepmann2022-09-22

Actions
Actions

Also available in: Atom PDF