Project

General

Profile

Actions

Bug #95984

closed

Error in constants-editor for integer constants without defined range

Added by Thomas Anders about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2021-11-15
Due date:
% Done:

0%

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

Description

Currently there seems to be a problem with the constants manager.
Lets say we have some integer constant defined:

# customsubcategory=example=Some Category

# cat=some constants/example/100; type=int; label=A really nice integer
const.dyingInteger = 

After hitting save, we will receive this error message:

Changing the constant to an "int+" or an "int[0-100]" its working.

# cat=some constants/example/100; type=int+; label=A really nice integer
const.workingInteger = 
# cat=some constants/example/100; type=int[0-100]; label=A really nice integer
const.anotherWorkingInteger = 

The docs clearly say, the range is an optional parameter (https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/UsingSetting/TheConstantEditor.html#type).
So I think there is no check if the parameter is set, but you must set one at the moment.


Files

clipboard-202111151651-9fzbw.png (22.1 KB) clipboard-202111151651-9fzbw.png Thomas Anders, 2021-11-15 15:51

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #95945: Undefined array key warning in ExtendedTemplateServiceClosed2021-11-10

Actions
Actions #1

Updated by Thomas Anders about 3 years ago

I'm not sure if that is a good practice inside the core, but the error can easily be fixed by:

public/typo3/sysext/core/Classes/TypoScript/TypoScriptService.php
// changing line:1190 
// from:
if ($typeDat['paramstr']) {...}

//to
if (!empty($typeDat['paramstr'])) {...}
Actions #2

Updated by Thomas Anders about 3 years ago

I see - it is already fixed in latest master

if ($typeDat['paramstr'] ?? false) {...}

so - this could be closed

Actions #3

Updated by Oliver Hader about 3 years ago

  • Related to Bug #95945: Undefined array key warning in ExtendedTemplateService added
Actions #4

Updated by Oliver Hader about 3 years ago

  • Status changed from New to Closed

Thanks for reporting this. As you figured already, it has been addressed in issue #95945 in c1a6410daf1cbfa0bf913e6c2e995a107041931b

Actions

Also available in: Atom PDF