Skip to content

Invalid TypoScript condition for CookieConsent in TYPO3 v13 ([{$page.theme.cookieconsent.enable} == 1]) #1593

@febuchner

Description

@febuchner

Bug Report

Prerequisites

  • Can you reproduce the problem on TYPO3 v11.5 LTS
  • Can you reproduce the problem on TYPO3 v12.4 LTS
  • Can you reproduce the problem on TYPO3 v13.4
  • Did you perform a cursory search
    to see if your bug or enhancement is already reported?

Description

The Bootstrap Package currently includes a TypoScript condition in Configuration/TypoScript/CookieConsent/setup.typoscript that is no longer valid in TYPO3 v12/v13:

[{$page.theme.cookieconsent.enable} == 1]
    page {
        includeJSFooterlibs {
            contrib_cookieconsent = EXT:bootstrap_package/Resources/Public/Contrib/cookieconsent/cookieconsent.min.js
            bootstrap_cookieconsent = EXT:bootstrap_package/Resources/Public/JavaScript/Dist/bootstrap.cookieconsent.min.js
        }
    }
[end]

Since TYPO3 v12, TypoScript conditions are parsed using the Symfony Expression Language. The legacy {$...} syntax is not supported anymore and causes a parse error.

Steps to Reproduce

  1. Install TYPO3 v13.x with Bootstrap Package.
  2. Enable the theme constants (default setup).
  3. Load the frontend.

Expected behavior

The TypoScript condition should be parsed correctly.

Actual behavior

TYPO3 throws an error during TypoScript parsing:

TypoScript condition [{$page.theme.cookieconsent.enable} == 1] could not be parsed:
Unexpected character "$" around position 1 ...

Versions

TYPO3 v13.x (tested with 13.4)
bootstrap_package (latest release via Composer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions