Issue Bug Closed

#92375Undefined index: AdminPanel in fluid/Classes/Core/ViewHelper/ViewHelperResolver.php on line 65

David Bruchmann 09/22/20, 17:25 updated 09/29/20, 15:06

Description

The errormessage

Undefined index: AdminPanel in fluid/Classes/Core/ViewHelper/ViewHelperResolver.php on line 65

is shown in frontend.

The code in fluid is looking like this, line 65 is marked with “>>”:

    public function __construct()
    {
        $this->namespaces = $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces'];
        if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE && $this->getBackendUser() instanceof BackendUserAuthentication) {
>>          $configuration = $this->getBackendUser()->uc['AdminPanel'];
            if (isset($configuration['preview_showFluidDebug']) && $configuration['preview_showFluidDebug']) {
                $this->namespaces['f'][] = 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Debug';
            }
        }
    }

I think here should be probably a check if the variable exists in “uc”, if I’m not wrong it might never be set at all and it could be quite common that this error is shown. I don’t know the trigger though, therefore have no idea why I see this error for the first time.
A backtrace longer than two elements is killing the instance, but here it is:

[0]=> array(7) {
    ["file"]=> string(97) "typo3/sysext/core/Classes/Utility/GeneralUtility.php"
    ["line"]=> int(3423)
    ["function"]=> string(11) "__construct"
    ["class"]=> string(50) "TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver"
    ["object"]=> object(TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver)#1485 (2) {
        ["resolvedViewHelperClassNames":protected]=> array(0) { }
        ["namespaces":protected]=> array(3) {
            ["core"]=> array(1) {
                [0]=> string(26) "TYPO3\CMS\Core\ViewHelpers"
            }
            ["f"]=> array(2) {
                [0]=> string(28) "TYPO3Fluid\Fluid\ViewHelpers"
                [1]=> string(27) "TYPO3\CMS\Fluid\ViewHelpers"
            }
            ["formvh"]=> array(1) {
                [0]=> string(26) "TYPO3\CMS\Form\ViewHelpers"
            }
        }
    }
    ["type"]=> string(2) "->"
    ["args"]=> array(0) { }
}
[1]=> array(6) {
    ["file"]=> string(104) "typo3/sysext/extbase/Classes/Object/Container/Container.php"
    ["line"]=> int(194)
    ["function"]=> string(12) "makeInstance"
    ["class"]=> string(37) "TYPO3\CMS\Core\Utility\GeneralUtility"
    ["type"]=> string(2) "::"
    ["args"]=> array(1) {
        [0]=> string(50) "TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver"
    }
}

Reviews 2