Project

General

Profile

Actions

Bug #90900

closed

TypeError: "trim() expects parameter 1 to be string, null given" in ConstantConfigurationParser

Added by Julian Mair over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2020-03-31
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If you add something like such in your constants:

# customcategory=generaldata=Allgemeine Einstellungen
general {
    # cat=generaldata; type=boolean; label= Automatische Sprachweiterleitung aktivieren (im Frontend)
    lang_redirect_active = 0
}

... then this error occours in the BE Constant Editor/Browser (this worked without problems in v8 and v9):

(1/1) TypeError
trim() expects parameter 1 to be string, null given

in /var/www/html/httpdocs/typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php line 296

            }
            if (isset($editableComments[$const])) {
                $editableComments[$const]['name'] = $const;
                $editableComments[$const]['value'] = trim($value);
                $editableComments[$const]['default_value'] = trim($default[$const]);
            }
        }
        return $editableComments;
    }

if a string conversion like `trim((string)$default[$const]);` is applied, the error disappears...


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #89113: Cleanup Constant ParsingClosed2019-09-09

Actions
Actions

Also available in: Atom PDF