Project

General

Profile

Actions

Bug #98483

closed

PHP Warning: Undefined array key "foolala" in typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php line 1425

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

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

100%

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

Description

If ypu're trying a flexform that is not stored in the current flexform data you will get:

$this->pi_getFFValue($this->cObj->data['pi_flexform'], "foolala", "sDEF");

This can happen after you've extended the flexform but did not save it everynwhere.
So the value is missing.

This wan't a problem under PHP 7.4 but with PHP 8 you'll get this warning:

PHP Warning: Undefined array key "foolala" in typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php line 1425

Maybe this way?


    public function pi_getFFvalueFromSheetArray($sheetArray, $fieldNameArr, $value)
    {
        $tempArr = $sheetArray;
        foreach ($fieldNameArr as $k => $v) {
            if (MathUtility::canBeInterpretedAsInteger($v)) {
                if (is_array($tempArr)) {
                    $c = 0;
                    foreach ($tempArr as $values) {
                        if ($c == $v) {
                            $tempArr = $values;
                            break;
                        }
                        $c++;
                    }
                }
            } else {
                if (isset($tempArr[$v])){
                $tempArr = $tempArr[$v];
                }
            }
        }

        return isset($tempArr[$value]) ?  $tempArr[$value] : '';
    }

Actions #1

Updated by Gerrit Code Review about 2 years ago

  • Status changed from New to Under Review

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

Actions #2

Updated by Gerrit Code Review about 2 years ago

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

Actions #3

Updated by Gerrit Code Review about 2 years ago

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

Actions #4

Updated by Georg Ringer about 2 years ago

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

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF