Skip to content
Snippets Groups Projects
user avatar
Garvin Hicking authored
Attributes passed via TypoScript like:

```
page {
    includeJSLibs {
      someIncludeFile = EXT:sitepackage/...
      someIncludeFile.forceOnTop = 1
    }
```

were wrongly passed on to the `<script>` tag, resulting in:

```
<script src="/_assets/…" forceontop="1"></script>
```

This patch streamlines removing the specific `<script>` and `<link>`
tag attributes with a central function to prevent further copy+paste
differences, and better makes visible which TypoScript attributes
are removable for which type. Tests are added to ensure this works,
and can act as a regression check.

All of the keys that are unset from `additionalAttribute`s are handled
through their `addCssFile/addCssLibrary/addJsFile/addJsFooterLibrary()`
methods, and thus would not be emitted again.

Please note, this patch deals with one part of the issue. The other
portion about whether "data." is a good TypoScript subkey or not
is beyond scope, and was already fixed in documentation.

Resolves: #100954
Releases: main, 12.4
Change-Id: Icd0f7e958387c985b7373623a0fba3656120a57a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84182


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
d6bb232f