Commit 5f554b6
[!!!][FEATURE] Support TYPO3 v13 and v14 in one version (#36)
* [TASK] Update repository metadata and TER publishing
The export-ignore list still named files this repository does not have,
while /Build and /Tests were missing from it, so both would have ended up
in a TER release. The eol list is sorted and gains the file types the
repository actually carries.
The publish workflow used the removed ::set-output syntax, which GitHub
Actions no longer evaluates, so the version and comment reached tailor
empty. It now writes to $GITHUB_OUTPUT, runs on ubuntu-latest with PHP
8.3, and checks out with the full history that "git tag -n10" needs to
read the tag annotation.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* [!!!][FEATURE] Support TYPO3 v13 and v14 in one version
The extension was last released as 10.0.4 in 2021. The v11 and v12 work on
develop was never tagged, and two unmerged branches carried an unfinished
migration to site sets. This brings all of it to one version that serves
TYPO3 13.4 LTS and TYPO3 14 together, on PHP 8.2 and up.
One version can serve both because the API this extension uses is the same
on either: the settings API, BeforeJavaScriptsRenderingEvent,
ResolveJavaScriptImportEvent and the AsEventListener attribute are
unchanged between 13.4 and 14.3, and both require PHP 8.2. The one real
difference is Fluid 4 against Fluid 5, which the ViewHelper handles by
registering its tag attributes as plain arguments, because
registerTagAttribute() was removed with Fluid 5.
The identifier argument of the script ViewHelper is now used as the
AssetCollector identifier. It was a required argument that had no effect,
so calling the ViewHelper twice with the same identifier now injects the
script once, which is what the argument always documented.
Defects fixed along the way:
* A site that does not include the site set answered HTTP 500 on every
page, because an absent settingsId failed the identifier check and threw
InvalidArgumentException 1583774571.
* An empty settingsId passed that same check and rendered a script tag
with an empty ID instead of reporting the misconfiguration.
* Incomplete jsFiles and jsInline entries failed on an undefined array key
instead of raising the documented exceptions.
* Usercentrics was rendered in backend requests.
* The useNonce argument was registered but never applied. It now maps to
the AssetCollector option matching the running major, because v14
deprecated useNonce in favour of csp.
* The settings type module was tagged "settings.type" in
JavaScriptModules.php, a tag no core code reads. The import is
registered through ResolveJavaScriptImportEvent instead, which is what
makes the editor resolve it.
* composer.json declares extra.typo3/cms.version and an empty
providesPackages. Without both, TYPO3 v14 still evaluates ext_emconf.php
and raises a deprecation. The file stays, because the TER reads it.
Co-Authored-By: Marvin Buchmann <marvin.buchmann@typo3.com>
Co-Authored-By: Benjamin Franzke <ben@bnf.dev>
Co-Authored-By: Alexander Hahn <alexander@hahn.mg>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* [TASK] Add unit and functional test suites
The extension carried a single unit test class. What the event listener and
the ViewHelper actually put into the AssetCollector was never asserted, and
nothing proved that one code base renders the same on both majors.
57 unit tests cover the event listener, the ViewHelper, the file settings
type and the import map listener, including the defects this branch fixes.
9 functional tests render real frontend pages through the site set and
cover both documented ways of including a script; the regression test for
the untouched site fails against the previous state with
InvalidArgumentException 1583774571.
The suites are green on TYPO3 13.4.34 with Fluid 4.6.1, on 14.3.6 with
Fluid 5.3.1, and on the lowest dependency set. CI runs both majors on PHP
8.2, 8.3 and 8.4 plus a lowest run, and installs the TYPO3 version under
test with "composer update --with" instead of requiring it and checking
composer.json back out. Functional tests run on SQLite there, which is why
the workflow installs pdo_sqlite. CGL and lint move into a separate job, so
a formatting error does not hide a failing test matrix.
php-cs-fixer is configured in .php-cs-fixer.dist.php, the name the tool has
looked for since v3, and reports with --diff instead of -v.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* [TASK] Add a DDEV based development installation
Nothing in the repository brought the extension up in a browser. Reviewing
a rendering change meant building an installation by hand first.
.ddev/config.yaml declares the container only; the installation itself
stays out of the repository, which is why extra.typo3/cms.app-dir is
dropped and TYPO3 writes config/ below the Composer root, ignored like
var/. typo3/cms-install and typo3/cms-filelist are required for
development: the first provides the setup command the README documents,
the second the element browser the file settings type opens.
Build/usercentrics_demo is a development-only extension, wired in as a
path repository. Its site set provides the page TypoScript and a Fluid
template using the ViewHelper, so the rendering can be looked at. It is
never released, because Build/ is export-ignored.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* [DOCS] Rewrite documentation for the site set configuration
The manual described a static template the extension no longer ships, wrote
YAML examples in TypoScript syntax, documented the priority option at the
wrong level and carried a PHP example that could not run. It is corrected
and migrated from Settings.cfg to guides.xml, the format the rendering
toolchain reads.
The README now covers what the extension supports, how a site includes the
site set, both ways of registering a script, the migration from 12.x, and
how to bring the development installation up and run the test suites.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* [TASK] Clean up and add csp attribute
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Marvin Buchmann <marvin.buchmann@typo3.com>
Co-authored-by: Benjamin Franzke <ben@bnf.dev>
Co-authored-by: Alexander Hahn <alexander@hahn.mg>1 parent 04c530f commit 5f554b6
40 files changed
Lines changed: 1917 additions & 555 deletions
File tree
- .ddev
- .github/workflows
- Build
- tools/phplint
- usercentrics_demo
- Configuration/Sets/Demo
- Resources/Private/Templates
- Classes
- EventListener
- AssetRenderer
- Settings/Type
- ViewHelpers
- Configuration
- Documentation
- Configuration
- Introduction
- Usage
- Tests
- Functional
- Fixtures
- Templates
- TypoScript
- Frontend
- Unit
- EventListener
- AssetRenderer
- Settings/Type
- ViewHelpers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 11 | + | |
24 | 12 | | |
25 | | - | |
26 | | - | |
| 13 | + | |
27 | 14 | | |
28 | 15 | | |
| 16 | + | |
29 | 17 | | |
30 | 18 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 19 | | |
36 | | - | |
| 20 | + | |
| 21 | + | |
37 | 22 | | |
38 | 23 | | |
39 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
7 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
8 | 40 | | |
9 | 41 | | |
10 | 42 | | |
11 | 43 | | |
12 | | - | |
| 44 | + | |
13 | 45 | | |
| 46 | + | |
14 | 47 | | |
15 | | - | |
| 48 | + | |
| 49 | + | |
16 | 50 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 51 | + | |
21 | 52 | | |
22 | 53 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 54 | + | |
32 | 55 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
37 | 62 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
43 | 69 | | |
44 | | - | |
45 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
46 | 74 | | |
47 | | - | |
48 | | - | |
| 75 | + | |
| 76 | + | |
49 | 77 | | |
50 | | - | |
51 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
35 | 38 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
44 | 47 | | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | | - | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
13 | 7 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 8 | + | |
| 9 | + | |
17 | 10 | | |
18 | 11 | | |
19 | 12 | | |
| |||
31 | 24 | | |
32 | 25 | | |
33 | 26 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
42 | 38 | | |
43 | | - | |
| 39 | + | |
| 40 | + | |
44 | 41 | | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 47 | | |
53 | 48 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 49 | | |
64 | | - | |
65 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
66 | 54 | | |
67 | 55 | | |
68 | 56 | | |
69 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
70 | 61 | | |
71 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments