Commit 986526a
[!!!][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.
Configuration moves from TypoScript to site sets
------------------------------------------------
The static template is gone. Sites include the site set t3g/usercentrics
and configure the extension in their site settings, which is also what
made the extension work on v14 at all, because TypoScriptFrontendController
was removed there. A settings type "uc_file" with a backend editor
component lets the scripts be maintained in the site settings module
rather than in YAML alone.
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.
* 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.
Tests
-----
57 unit and 9 functional tests, 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. The
functional suite renders real frontend pages through the site set and
covers both documented ways of including a script; its regression test for
the untouched site fails against the previous state with the exception
above. CI runs both majors on PHP 8.2, 8.3 and 8.4 plus a lowest run.
Development installation
------------------------
.ddev/config.yaml declares the container, the installation itself stays
out of the repository. Build/usercentrics_demo is a development-only
extension whose site set provides the page TypoScript and a Fluid template
using the ViewHelper, so the rendering can be looked at in a browser. The
install commands are in the README and were run from a clone-like state.
Documentation is migrated to guides.xml, and the configuration and usage
chapters are corrected: they described the removed static template, wrote
YAML examples in TypoScript syntax, documented priority at the wrong
level and carried a PHP example that could not run.
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>
Claude-Session: https://claude.ai/code/session_01Nr2wDgiyGJq1TAMeCSCjfA1 parent 04c530f commit 986526a
40 files changed
Lines changed: 1916 additions & 551 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