benjaminkott / benjaminkott/bootstrap_package

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
bug
Dominant language
PHP
Stars
355
Forks
212
Avg merge
1h 4m
Merged PRs (30d)
31

Description

# Bug Report

## Prerequisites

* [ ] Can you reproduce the problem on TYPO3 v11.5 LTS
* [x] Can you reproduce the problem on TYPO3 v12.4 LTS
* [x] Can you reproduce the problem on TYPO3 v13.4
* [x] Did you [perform a cursory search](https://github.com/issues?q=is%3Aissue+user%3Abenjaminkott+repo%3Abenjaminkott%2Fbootstrap_package)
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)

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.