Review 12.4 Merged

84206[BUGFIX] Do not pass TypoScript attributes as script/link tag attribute

Garvin Hicking CR +2 V +2 Hard +310 −54 updated 05/13/24, 22:07

Commit message

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.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 57

  1. Garvin Hicking commented on patch set 1 05/13/24, 20:49

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/frontend/Classes/Http/RequestHandler.php
  2. core-ci voted on patch set 1 V -1 05/13/24, 21:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57648

  3. Garvin Hicking uploaded patch set 2 V -1 05/13/24, 21:05

    Resolve conflicts
  4. Garvin Hicking marked it ready for review 05/13/24, 21:11

  5. core-ci voted on patch set 2 V +1 05/13/24, 21:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57650

  6. Stefan Bürk commented on patch set 2 CR +2 V +2 05/13/24, 22:06

    Thanks for providing the backport @gh@faktor-e.de
  7. Stefan Bürk merged patch set 3 05/13/24, 22:07