Project

General

Profile

Bug #103364

Updated by Philipp Kitzberger 2 months ago

Before *TYPO3 12* it was possible to have recursive constants, which made it possible to set TS constants to values defined in the site config settings. 

 I get that the (undocumented) "10-step-recursion-resolving had to go":https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97816-TypoScriptSyntaxChanges.html?highlight=nested%20constants#streamlined-constants-usage. So no argument with that. But I'd like to find a solution for the evident drawback I'm facing now. 

 As soon as I include an extensions TypoScript (that is *constants+setup*, with constants usually set to empty values), it's not possible to override those constants with "site constants" anymore. 

 A workaround could be to override those parts of the setup (where the constants are being read) and change the name of the constants! Since variables are often being used in multiple parts of the setup stack that cannot be the solution. 

 Take this (randomly chosen) snippet from EXT:powermail's TypoScript setup: 
 <pre> 
 plugin.tx_powermail.settings.setup.main.pid = {$plugin.tx_powermail.settings.main.pid} 
 </pre> 
 In order to override that setting I would have to change the TypoScript setup to this e.g. 
 <pre> 
 plugin.tx_powermail.settings.setup.main.pid = {$plugin.tx_powermail.settings.main.pid_override_from_site} 
 </pre> 
 And add this new constant to the site config: 
 <pre> 
 settings: 
   plugin: 
     tx_powermail: 
       setup: 
         main: 
           pid_override_from_site_config: 123 
 </pre> 

 Here's a screenshot of how the constant stack is being put together: 

 !Bildschirmfoto%20vom%202024-03-11%2018-36-54.png! 

 With TYPO3 11 one simply had to set the extension's constant to the custom constant and it's been resolves correctly: 
 <pre> 
 plugin.tx_powermail.settings.main.pid = {$plugin.tx_powermail.settings.main.pid_override_from_site} 
 </pre> 

Back