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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 3