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 #1

Updated by Thomas Anders 3 months ago

  • Description updated (diff)

fixed codeblocks

Actions #2

Updated by Thomas Anders 3 months ago

  • Description updated (diff)

Added some mor info and fixed inline "code"

Actions #3

Updated by Stefan Bürk 3 months ago


monorepo main versus monorepo 11.5
- part issue 1 not displaying all subcategories of a category

Actions #4

Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 3 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/+/82898

Actions #5

Updated by Stefan Bürk 3 months ago

Actions #6

Updated by Stefan Bürk 3 months ago

Hi Naderio,

1) and 2) are bugs which are solveable. As shown, it's already broken or core system extensions (ext:felogin). See attached patch which is fixing this.

Regardin 3), due to changes in the Parsing this is no longer possible since 12.0 (breaking) and not gonna be. On a long term the whole constante editor should be solved in a more modern approach and with a better API at all. It's not possible to reintroduce the old behaviour easily and without quite some work so that has to be taken as won't fix, working as intended (breaking) - will recondider that we document that in some way (with a dedicated patch / documentation).

Actions #7

Updated by Gerrit Code Review 3 months ago

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

Actions #8

Updated by Stefan Bürk 3 months ago

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

Also available in: Atom PDF