Issue Bug Closed

#104726Constants used within TypoScript setup text are not correctly displayed in "Active TypoScript"

Lina Wolf 08/25/24, 10:06 updated 12/02/25, 14:33

Description

Using the current main branch of the TYPO3 mono repository

I create one TypoScript backend root record and add the following:

  1. Constants:
    tx_my_sitepackage {
        bgCol = bg-primary
        file.toplogo = EXT:my_sitepackage/Resources/Public/Images/Logo.png
    }
  1. Setup:
    page = PAGE
    page {
        typeNum = 0
        bodyTag = <body class="{$tx_my_sitepackage.bgCol}">
        10 = IMAGE
        10.file = {$tx_my_sitepackage.file.toplogo}
    }

When “Show constant usage” is enabled there is an empty label and the constants are replaced without beeing marked:
clipboard-202408251203-g6vjo.png

This behaviour is different from how constant usage from TypoScript from extensions is displayed:
clipboard-202408251205-e2l2l.png

Reviews 1

Files 6

History 1112

  1. Lina Wolf changed subject Constants from the TypoScript backend report are not replaced correctly in "Active TypoScript" Constants used within TypoScript setup text are not correctly displayed in "Active TypoScript" <span data-processor="relativetime" data-value="2024-08-25T10:09:07+00:00" > 08/25/24, 10:09 </span>

  2. Lina Wolf commented and changed attached clipboard-202408251210-hjr9f.png <span data-processor="relativetime" data-value="2024-08-25T10:10:44+00:00" > 08/25/24, 10:10 </span>

    Edit: Constants are not replaced if they are used within a text but used when replaced directly without surrounding text:

    clipboard-202408251210-hjr9f.png

  3. Franz Holzinger commented and changed attached ConstantsUnset-Example-active.png attached ConstantsUnset-Example-included,png attached Setup-ConstantsSet.png <span data-processor="relativetime" data-value="2024-09-06T13:54:29+00:00" > 09/06/24, 13:54 </span>

    I confirm this.
    In my example there exists the constant plugin.tt_products.clickEnlarge, which is unset to 0. But in the active TypoScript it shows up as set to 1. I have cleared all caches in the Install Tool and backend. I have also added a local TypoScript constant which also unset it to 0. No change.

    See the 3 screen shots.

  4. Christian Kuhn commented <span data-processor="relativetime" data-value="2024-10-15T10:08:34+00:00" > 10/15/24, 10:08 </span>

    Confirmed. Odd.

    This works in both v12 and v13:

    constants:
    myConstant.bar = foobar
    
    setup:
    myConstantUsage = TEXT
    myConstantUsage.value = foo {$myConstant.bar} bar

    This fails to render the constant substitution in v13, but it works in v12:

    constants:
    tx_my_sitepackage {
        bgCol = bg-primary
    }
    
    setup:
    page >
    page = PAGE
    page {
        typeNum = 0
        bodyTag = <body class="{$tx_my_sitepackage.bgCol}">
    }
  5. Christian Kuhn commented <span data-processor="relativetime" data-value="2024-10-15T10:47:59+00:00" > 10/15/24, 10:47 </span>

    This is due to strip_tags() in FineDiffViewhelper.

  6. Gerrit Code Review pushed patch set 1 for main to change 86605 status Accepted Under Review <span data-processor="relativetime" data-value="2024-10-15T10:55:47+00:00" > 10/15/24, 10:55 </span>

  7. Christian Kuhn commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-10-17T10:50:09+00:00" > 10/17/24, 10:50 </span>

    Applied in changeset commit:d8311d963abbedf66987802c6badd69d9dafc3a9.