Project

General

Profile

Actions

Bug #94707

closed

Undefined array key / Trying to access array offset on value of type null / PHP Version 8.0.8

Added by Michael Kasten over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2021-08-04
Due date:
% Done:

0%

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

Description

PHP version: 8.0.8
PHP CGI detected: Yes
Version: MySQL 5.5.5-10.3.29-MariaDB-0+deb10u1

These Errormessages are flooding the Logtable, getting multiple errors like this in one second, setting debug presett will breake the frontend.

Core: Error handler (BE): PHP Warning: Undefined array key "tx_news_pi1" in typo3_src-11.3.1/vendor/symfony/expression-language/Node/GetAttrNode.php line 97 
Core: Error handler (BE): PHP Warning: Undefined array key "defaultContentRendering" in typo3_src-11.3.1/typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php line 957 
Core: Error handler (FE): PHP Warning: Undefined array key "excludeFromConcatenation" in typo3_src-11.3.1/typo3/sysext/frontend/Classes/Http/RequestHandler.php line 447

Same Projekt running under PHP 7.4.3 dosnt show these errors so i guess its a Problem with the PHP Version

Confusing about the tx_news_pi1 error because there is no news extension installed

Is 11.3.1 realy PHP 8.0.x ready?


Files

env.png (22.1 KB) env.png Xavier Perseguers, 2021-10-08 07:01

Related issues 11 (1 open10 closed)

Related to TYPO3 Core - Bug #95082: Add fallback for undefined key in RequestHandler/TypoScriptFrontendControllerClosed2021-09-02

Actions
Related to TYPO3 Core - Bug #95536: Undefined array key when cut ce in list view and paste in page viewClosed2021-10-08

Actions
Related to TYPO3 Core - Bug #95563: Undefined key warnings in ContentObjectRenderer.phpClosed2021-10-11

Actions
Related to TYPO3 Core - Bug #95781: PHP Warning: Undefined array key "uid" in /app/vendor/symfony/expression-language/Node/GetAttrNode.phpRejected2021-10-26

Actions
Related to TYPO3 Core - Bug #96907: Undefined array key "uid" - /symfony/expression-language/Node/GetAttrNode.php line 97Closed2022-02-15

Actions
Related to TYPO3 Core - Bug #97624: Undefined array key "module" - /symfony/expression-language/Node/GetAttrNode.php line 97Closed2022-05-13

Actions
Related to TYPO3 Core - Bug #98197: Undefined array key in form variants if variable of variant condition is emptyClosed2022-08-24

Actions
Related to TYPO3 Core - Bug #98515: Undefined array key with symfony expression results in log entriesRejectedFrank Nägler2022-10-04

Actions
Related to TYPO3 Core - Bug #99001: PHP Warning: Undefined array key "module" in /typo3_src-11.5.17/vendor/symfony/expression-language/Node/GetAttrNode.php line 97Closed2022-11-04

Actions
Related to TYPO3 Core - Bug #99130: Form Variants: Dynamic validators on formValues break in PHP 8Under Review2022-11-18

Actions
Related to TYPO3 Core - Bug #99866: Undefined array key "sectionIndex." in AbstractMenuContentObject.phpClosed2023-02-07

Actions
Actions #1

Updated by Oliver Bartsch over 2 years ago

Hi, regarding

Core: Error handler (BE): PHP Warning: Undefined array key "tx_news_pi1" in typo3_src-11.3.1/vendor/symfony/expression-language/Node/GetAttrNode.php line 97 

this does not mean EXT:news is installed but that your installation contains a TypoScript Condition with tx_news_pi1 as array key. Maybe something like:

request.getQueryParams()['tx_news_pi1'] == 1
Actions #2

Updated by Benni Mack over 2 years ago

  • Target version changed from 11.4 to 11 LTS
Actions #3

Updated by Michael Kasten over 2 years ago

Hi,

@oliver: your right there was a condition left for ext news, removed and this error was fixed!

I'm testing today with the 11.4 release, the log show me more and more "undefined key array" issues

PHP Warning: Undefined array key "allWrap" in /var/www/html/typo3_src-11.4.0/typo3/sysext/frontend/Classes/Http/RequestHandler.php line 446     

$cssFileConfig['allWrap'],
PHP Warning: Undefined array key "forceOnTop" in /var/www/html/typo3_src-11.4.0/typo3/sysext/frontend/Classes/Http/RequestHandler.php line 445     

(bool)$cssFileConfig['forceOnTop']

PHP Warning: Undefined array key "inline" in /var/www/html/typo3_src-11.4.0/typo3/sysext/frontend/Classes/Http/RequestHandler.php line 444     

(bool)$cssFileConfig['inline']
PHP Warning: Undefined array key "external" in /var/www/html/typo3_src-11.4.0/typo3/sysext/frontend/Classes/Http/RequestHandler.php line 444     

$cssFileConfig['external']

PHP Warning: Undefined array key "title" in /var/www/html/typo3_src-11.4.0/typo3/sysext/frontend/Classes/Http/RequestHandler.php line 443     

$cssFileConfig['title']

All this warnings are shown as errors inside the Logfile, the Problem is: Calling a page for the frontend will produce ~70 Logentries in one second so the Log table was flooded by the time (i know that there is a scheduler command for clearing, but it is difficult to see real problem with all these stuff inside the Logtable)

the example above ist touching the css processing (line 414:456) the same problem exists on the js processing also

I guess there a some proofs neccessary like

if(isset($table[$key])) {

or better

$table[$key] = $table[$key] ?? null;
Actions #4

Updated by Jochen Roth over 2 years ago

  • Related to Bug #95082: Add fallback for undefined key in RequestHandler/TypoScriptFrontendController added
Actions #5

Updated by Benni Mack over 2 years ago

  • Target version changed from 11 LTS to Candidate for patchlevel
Actions #6

Updated by Jochen Roth over 2 years ago

@Michael, this should be fixed in 11.5

Can you please verify? Thank you.

Actions #7

Updated by Xavier Perseguers over 2 years ago

I've got a similar error:

PHP Warning: Undefined array key "tt_content" 

while trying to cut/paste a content element from one page to another one, thus in Backend.

Actions #8

Updated by Xavier Perseguers over 2 years ago

Now that I moved my content element manually in database, I have another error while using Web > Page:

PHP Warning: Undefined array key "mode" in /path/to/private/typo3/sysext/backend/Classes/Controller/PageLayoutController.php line 648
Actions #9

Updated by Xavier Perseguers over 2 years ago

  • File env.png env.png added
  • Status changed from New to Accepted
  • Priority changed from Should have to Must have
  • Target version changed from Candidate for patchlevel to next-patchlevel

Environment:

Actions #10

Updated by Jochen Roth over 2 years ago

Xavier Perseguers wrote in #note-7:

I've got a similar error:

[...]

while trying to cut/paste a content element from one page to another one, thus in Backend.

This is already fixed in latest master:
https://github.com/TYPO3/typo3/blob/master/typo3/sysext/backend/Classes/Controller/SimpleDataHandlerController.php#L270

Actions #11

Updated by Jochen Roth over 2 years ago

  • Related to Bug #95536: Undefined array key when cut ce in list view and paste in page view added
Actions #12

Updated by Jochen Roth over 2 years ago

Xavier Perseguers wrote in #note-8:

Now that I moved my content element manually in database, I have another error while using Web > Page:

[...]

This patch will fix the undefined mode:w
https://review.typo3.org/c/Packages/TYPO3.CMS/+/71504

Actions #13

Updated by Michael Kasten over 2 years ago

@Jochen Fröhlich i guess these errors are fixed but there are some more issues with this behaviour:


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 :)

Actions #14

Updated by Jochen Roth over 2 years ago

  • Related to Bug #95563: Undefined key warnings in ContentObjectRenderer.php added
Actions #15

Updated by Jochen Roth over 2 years ago

Michael Kasten wrote in #note-13:

@Jochen Fröhlich i guess these errors are fixed but there are some more issues with this behaviour:

[...]

[...]

[...]

[...]

[...]

As far as I can see :)

Moved to #95563 ... can't have all the PHP8 undefined key warning in a single issue. I prefer smaller chunks to work on.

Actions #16

Updated by Christian Kuhn about 2 years ago

  • Status changed from Accepted to Closed

Hey. I hope it's ok to close here.

We fixed tons of PHP 8 related array-key access warnings in the last month, and it's impossible to keep track if the some of the single ones above are still open (they're most likely fixed meanwhile).

Single bugs may still appear in less-often used core areas, though. Those should be fixed with single issues, gathering multiple places in one bug report is very hard to keep track of.

As such, I'll close the issue now: When current v11 patch level releases still emit such warnings, please create new issues per case, at best together with a backtrace and/or how-to-reproduce.

Actions #17

Updated by Felix Nagel over 1 year ago

  • Related to Bug #95781: PHP Warning: Undefined array key "uid" in /app/vendor/symfony/expression-language/Node/GetAttrNode.php added
Actions #18

Updated by Felix Nagel over 1 year ago

  • Related to Bug #96907: Undefined array key "uid" - /symfony/expression-language/Node/GetAttrNode.php line 97 added
Actions #19

Updated by Felix Nagel over 1 year ago

  • Related to Bug #97624: Undefined array key "module" - /symfony/expression-language/Node/GetAttrNode.php line 97 added
Actions #20

Updated by Felix Nagel over 1 year ago

  • Related to Bug #98197: Undefined array key in form variants if variable of variant condition is empty added
Actions #21

Updated by Felix Nagel over 1 year ago

  • Related to Bug #98515: Undefined array key with symfony expression results in log entries added
Actions #22

Updated by Felix Nagel over 1 year ago

  • Related to Bug #99001: PHP Warning: Undefined array key "module" in /typo3_src-11.5.17/vendor/symfony/expression-language/Node/GetAttrNode.php line 97 added
Actions #23

Updated by Felix Nagel over 1 year ago

  • Related to Bug #99130: Form Variants: Dynamic validators on formValues break in PHP 8 added
Actions #24

Updated by Benjamin Robinson about 1 year ago

  • Related to Bug #99866: Undefined array key "sectionIndex." in AbstractMenuContentObject.php added
Actions

Also available in: Atom PDF