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

Open
#1,593 16 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
bootstrap
Domain
frontend, web-dev

Research direction

Open Configuration/TypoScript/CookieConsent/setup.typoscript and inspect the CookieConsent condition around page.includeJSFooterlibs. Reproduce on TYPO3 v13.4 by loading the frontend with the theme constants enabled, then verify that TypoScript parses without the reported error and the cookie-consent assets remain included.

Written by the indexing model from the issue text.

Description

bug

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)

Dominant language
PHP
Stars
354
Forks
209
Avg merge
1m
Merged PRs (30d)
2

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from benjaminkott/bootstrap_package

All issues in benjaminkott/bootstrap_package

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.