Bug #95563

Undefined key warnings in ContentObjectRenderer.php

Added by Jochen Roth about 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2021-10-11
Due date:
% Done:

100%

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

Description


Undefined array key "typolink." in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 1043

$content = (string)$this->typoLink($string, $conf['typolink.']);

#maybe should be

$content = (string)$this->typoLink($string, $conf['typolink.'] ?? []);

Undefined array key "crop" in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 1070

$conf[$parameterName] = $this->stdWrap($conf[$parameterName], $conf[$parameterName . '.']);

#maybe should be

$conf[$parameterName] = $this->stdWrap($conf[$parameterName], $conf[$parameterName . '.'] ?? []);

Undefined array key "m." in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 4084

$maskArray = $fileArray['m.'];

#maybe should be

$maskArray = $fileArray['m.'] ?? [];

Undefined array key "addQueryString" in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php line 627

$getVars = $this->parent_cObj->getQueryArguments($this->conf['addQueryString.']);

#maybe should be

$getVars = $this->parent_cObj->getQueryArguments($this->conf['addQueryString.'] ?? []);


Undefined array key 1 in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php line 973

$endKey = $this->parent_cObj->getKey($begin_end[1], $this->tmpl->rootLine);

#maybe should be

$endKey = $this->parent_cObj->getKey($begin_end[1] ?? [], $this->tmpl->rootLine);

As far as I can see :)


Files


Related issues

Related to TYPO3 Core - Bug #94707: Undefined array key / Trying to access array offset on value of type null / PHP Version 8.0.8Accepted2021-08-04

Actions
#1

Updated by Jochen Roth about 2 months ago

  • Related to Bug #94707: Undefined array key / Trying to access array offset on value of type null / PHP Version 8.0.8 added
#2

Updated by Jochen Roth about 2 months ago

Already fixed in latest master:

  • Undefined array key 1 in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php line 973
  • Undefined array key "addQueryString" in /var/www/html/typo3_src-11.5.0/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php line 627
#3

Updated by Jochen Roth about 2 months ago

@Michael Kasten can you please test in latest master. Tried to reproduce these issues but seemed to work without the warnings thrown.

#4

Updated by Michael Kasten about 2 months ago

Hi Jochen,

shame on me, i told to my collegues all day: every single issue should be a separate ticket, and on my self... damned

Ok here we go im cloned the latest master into my project, and thats is the result

I guess most issues are unfixed because the files are untouched here:

i guess there ary only one fix for AbstractMenuContentObject.php line 973 available.

Hope the information will help you :)

#5

Updated by Michael Kasten about 2 months ago

Some additional informations will maybe help you:

Tested with a regulär DDEV Container with nginx as webserver, no special php debugging settings, for the enviroment see image :)

#6

Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71534

#7

Updated by Gerrit Code Review about 2 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71534

#8

Updated by Gerrit Code Review about 2 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71534

#9

Updated by Anonymous about 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF