Project

General

Profile

Actions

Bug #98468

closed

PHP Warning: Undefined array key "stdWrap2" in TextMenuContentObject.php line 123

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

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2022-09-29
Due date:
% Done:

100%

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

Description

PHP Warning: Undefined array key "stdWrap2" in /data/www/sites/baden-wuerttemberg.de/shared/typo3_src/typo3_src-11.5.16/typo3/sysext/frontend/Classes/ContentObject/Menu/TextMenuContentObject.php line 123

Code:

if (($this->I['val']['stdWrap2'] ?? false) || isset($this->I['val']['stdWrap2.'])) {

If $this->I['val']['stdWrap2'] isn't set this will produce a PHP Warning.

Like this?


          if (! isset($this->I['val']['stdWrap2'])){
                $this->I['val']['stdWrap2'] = '';
            }

            if (($this->I['val']['stdWrap2'] ?? false) || isset($this->I['val']['stdWrap2.'])) {
                $stdWrap2 = (string)(isset($this->I['val']['stdWrap2.']) ? $this->WMcObj->stdWrap('|', $this->I['val']['stdWrap2.']) : '|');
                $wrapPartsStdWrap = explode($this->I['val']['stdWrap2'] ?: '|', $stdWrap2);
            } else {
                $wrapPartsStdWrap = ['', ''];
            }

Actions

Also available in: Atom PDF