Skip to content
Snippets Groups Projects
  1. Jun 05, 2024
    • Garvin Hicking's avatar
      [BUGFIX] Add constant evaluation in TypoScript functions · 837f5b0b
      Garvin Hicking authored
      We missed a TypoScript feature with the new parser.
      Function operator modifier values can use constants:
      
      foo = 42
      foo := addToList({$my.constant})
      
      The solution is two fold: Until now, the value of a
      function body was a single T_VALUE token. This is
      turned into a stream of tokens that can consist of
      multiple T_VALUE and T_CONSTANT tokens. This is
      handled in the tokenizers. Secondly, the AST builders
      need to deal with these token streams now, and take
      care available constants are hand over to
      ConstantAwareTokenStream before the stream is cast
      to string and single functions are evaluated.
      
      The BE modules *do* reflect constant substitutions in
      function modifier bodies, but not in an ideal way.
      An @todo within the responsible CommentAwareAstBuilder
      outlines ideas how this could be improved.
      
      Note TYPO3 v13 supports constant fallbacks here
      as well, this syntax feature came with #103671.
      This works, but is NOT supported in v12:
      
      foo := addToList({$my.constant ?? $fallback.constant})
      
      Resolves: #102742
      Related: #97816
      Related: #103671
      Releases: main, 12.4
      Change-Id: Ib5e0872fe1ea2b78bd0a7e05caccd9874b5668d4
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84498
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      837f5b0b
  2. Jun 04, 2024
  3. Jun 03, 2024
  4. Jun 02, 2024
  5. Jun 01, 2024
  6. May 31, 2024
  7. May 29, 2024
  8. May 28, 2024
  9. May 27, 2024
  10. May 26, 2024
  11. May 25, 2024
  12. May 24, 2024
  13. May 22, 2024
  14. May 21, 2024