Project

General

Profile

Bug #103088

Updated by Thomas Anders 10 months ago

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 

 !clipboard-202402090916-42zc4.png! 

 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* `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* `01_Storage` to *01_storage* , `01_storage`, which instantly let the constants appear and be sorted accordingly. 

 <pre><code class="shell"> 
 # 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 
 } 
 </code></pre> 

 *to 2* 
 here are some constants for testing, all ordered with the same letter *.../a* . `.../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) 


 <pre><code class="shell"> 
 # 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 
 } 
 </code></pre> 


 !clipboard-202402090932-mi4ze.png! 

 *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. extension like this: 

 <pre><code class="shell"> 
 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 
         } 
     } 
 } 
 </code></pre> 


 this will not work. The constant list is empty, but as before, the dropdown shows that there should be 2 constants. 
 !clipboard-202402090943-vzem2.png! 

Back