Project

General

Profile

Actions

Bug #103088

closed

Constant editor - categorization and listing broken

Added by Thomas Anders 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2024-02-09
Due date:
% Done:

100%

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

Description

The constant editor does not resolve constants and their according category/label correct.
I stumbled across this in my project, where I have a lot of constants. After an update to v12, the categories seemed to be ignored, but after further investigation, there are A TON of constants missing - even from core extensions.

Simplest way to check: Go to constant editor > frontend login

First, it says, there have to be 27 constants inside this category - but it shows only 8.
Second, the first subcategory is "other", but there should be 6 different custom subcategories.

I have found out that there are some differences since v12.
1. There's a problem with uppercase letters in custom subcategory names
2. If the ordering isn't unique, only one of the constants is shown
3. constants in multiple groups will not be shown

to 1
let's take a look into vendor/typo3/cms-felogin/Configuration/TypoScript/constants.typoscript
There are 6 categories, all including upper letters in the name. I changed the first from 01_Storage to 01_storage , which instantly let the constants appear and be sorted accordingly.

# customsubcategory=01_storage=Storage
# customsubcategory=02_Template=Template
# customsubcategory=03_Features=Features
# customsubcategory=04_EMail=Email
# customsubcategory=05_Redirects=Redirects
# customsubcategory=06_Security=Security

styles.content.loginform {
  # cat=Frontend Login/01_storage/100; type=string; label= User Storage Page: Define the Storage Folder with the Website User Records, using a comma separated list or single value
  pid = 0
  # cat=Frontend Login/01_storage/101; type=options [0,1,2,3,4,255]; label= Recursive: If set, also subfolder at configured recursive levels of the User Storage Page will be used
  recursive = 0
}

to 2
here are some constants for testing, all ordered with the same letter .../a .
This will only show one of the constants (spoiler: the last one), no matter how many there are.
However, the dropdown will show the correct amount (see screenshot)

# customsubcategory=testcategory=Testcategory

test {
  # cat=testing/testcategory/a; type=string; label=Test 01:Just testing around
  oneConstant = 0
  # cat=testing/testcategory/a; type=string; label=Test 02:Just testing around
  twoConstant = 0
  # cat=testing/testcategory/a; type=string; label=Test 03:Just testing around
  threeConstant = 0
}

to 3
This is maybe not ideal or an edge case, but that worked before 12

In the documentation it reads, that this should be possible - but it's not (https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/UsingSetting/TheConstantEditor.html#cat)

Lets say, I copy constants into my custom extension, to not overwhelm the customer with dozens of constants but only a few, and put them into a custom category.

plugin {
    # customsubcategory=femanmailconf=Femanager E-Mail Einstellungen
    tx_femanager {
        settings {
            # cat=custom - femanager/femanmailconf/a10; type=string; label=Admin Name:Name des Absenders der E-Mails
            adminName = Default Name
            # cat=custom - femanager/femanmailconf/a20; type=string; label=Absender-E-Mail:E-Mail Adresse die für den Versand verwendet wird.
            adminEmail = no-reply@tld.de
        }
    }
}

this will not work. The constant list is empty, but as before, the dropdown shows that there should be 2 constants.


Files


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #98357: Revamp Constant EditorClosed2022-09-16

Actions
Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Actions

Also available in: Atom PDF