From 3448bc5184f0b0246644a232e128ba21f33e736e Mon Sep 17 00:00:00 2001
From: Tobias Jungmann <186044798+dreistromland-tj@users.noreply.github.com>
Date: Mon, 23 Feb 2026 13:35:57 +0100
Subject: [PATCH 1/5] [TASK] #SIPACK-306 Add v14 compatibility, drop v12
---
Classes/Configuration/Extension.php | 2 +-
Classes/Hooks/FormElementLinkResolverHook.php | 4 ++--
Configuration/TCA/Overrides/sys_template.php | 6 ++++--
composer.json | 17 ++++++++++++-----
ext_emconf.php | 9 ++++-----
ext_localconf.php | 6 ++++--
6 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/Classes/Configuration/Extension.php b/Classes/Configuration/Extension.php
index bf7b5ce..25443c0 100644
--- a/Classes/Configuration/Extension.php
+++ b/Classes/Configuration/Extension.php
@@ -35,7 +35,7 @@
*/
final class Extension
{
- public const KEY = 'form_element_linked_checkbox';
+ public const string KEY = 'form_element_linked_checkbox';
public static function addTypoScriptSetup(): void
{
diff --git a/Classes/Hooks/FormElementLinkResolverHook.php b/Classes/Hooks/FormElementLinkResolverHook.php
index ce7461e..fdc15eb 100644
--- a/Classes/Hooks/FormElementLinkResolverHook.php
+++ b/Classes/Hooks/FormElementLinkResolverHook.php
@@ -38,12 +38,12 @@ final class FormElementLinkResolverHook
/**
* @var string Form element type to match
*/
- private $type = 'LinkedCheckbox';
+ private string $type = 'LinkedCheckbox';
/**
* @var FormRuntime The current form runtime
*/
- private $formRuntime;
+ private ?FormRuntime $formRuntime = null;
/**
* Resolve link in label of form elements with type LinkedCheckbox.
diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php
index 539e151..a6f083b 100644
--- a/Configuration/TCA/Overrides/sys_template.php
+++ b/Configuration/TCA/Overrides/sys_template.php
@@ -1,9 +1,11 @@
'Adds a new form element which allows the editor to create a checkbox with a linked label text.',
'category' => 'fe',
'state' => 'stable',
- 'clearCacheOnLoad' => 0,
- 'author' => 'Björn Jacob, Elias Häußler',
- 'author_email' => 'bjoern.jacob@tritum.de, elias@haeussler.dev',
- 'version' => '5.0.2',
+ 'author' => 'Björn Jacob, Elias Häußler, dreistrom.land',
+ 'author_email' => 'bjoern.jacob@tritum.de, elias@haeussler.dev, hello@dreistrom.land',
+ 'version' => '6.0.0',
'constraints' => [
'depends' => [
- 'typo3' => '12.4.0-13.4.99',
+ 'typo3' => '13.4.0-14.4.99',
],
'conflicts' => [],
'suggests' => [],
diff --git a/ext_localconf.php b/ext_localconf.php
index bb61de9..f592530 100644
--- a/ext_localconf.php
+++ b/ext_localconf.php
@@ -1,6 +1,8 @@
Date: Mon, 23 Feb 2026 13:46:54 +0100
Subject: [PATCH 2/5] [CLEANUP] #SIPACK-306 Replace tabs with spaces, fix order
in composer.json
---
.editorconfig | 14 ---
Resources/Private/Language/Database.xlf | 58 +++++-----
composer.json | 134 ++++++++++++------------
phpstan.neon | 10 +-
4 files changed, 101 insertions(+), 115 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 410d80b..a0f3a0e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -16,10 +16,6 @@ trim_trailing_whitespace = true
[*.{ts,js}]
indent_size = 2
-# JSON-Files
-[*.json]
-indent_style = tab
-
# ReST-Files
[*.rst]
indent_size = 4
@@ -32,7 +28,6 @@ indent_size = 2
# NEON-Files
[*.neon]
indent_size = 2
-indent_style = tab
# package.json
[package.json]
@@ -42,15 +37,6 @@ indent_size = 2
[*.{typoscript,tsconfig}]
indent_size = 2
-# XLF-Files
-[*.xlf]
-indent_style = tab
-
# SQL-Files
[*.sql]
-indent_style = tab
indent_size = 2
-
-# .htaccess
-[{_.htaccess,.htaccess}]
-indent_style = tab
diff --git a/Resources/Private/Language/Database.xlf b/Resources/Private/Language/Database.xlf
index d3ad08e..ebeecd8 100644
--- a/Resources/Private/Language/Database.xlf
+++ b/Resources/Private/Language/Database.xlf
@@ -1,32 +1,32 @@
-
-
-
-
- Page
-
-
- Pages
-
-
- Link text
-
-
- more...
-
-
- Additional links
-
-
- You can add more links here that should replace placeholders in the checkbox label.
-
-
- Link text
-
-
- Page
-
-
-
+
+
+
+
+ Page
+
+
+ Pages
+
+
+ Link text
+
+
+ more...
+
+
+ Additional links
+
+
+ You can add more links here that should replace placeholders in the checkbox label.
+
+
+ Link text
+
+
+ Page
+
+
+
diff --git a/composer.json b/composer.json
index 511c191..c3e3d33 100644
--- a/composer.json
+++ b/composer.json
@@ -1,70 +1,70 @@
{
- "name": "tritum/form-element-linked-checkbox",
- "description": "Adds a new form element which allows the editor to create a checkbox with a linked label text. This is an extension for TYPO3 CMS.",
- "license": "GPL-2.0-or-later",
- "type": "typo3-cms-extension",
- "homepage": "https://github.com/tritum/form_element_linked_checkbox",
- "authors": [
- {
- "name": "Björn Jacob",
- "email": "bjoern.jacob@tritum.de",
- "homepage": "https://www.tritum.de",
- "role": "Developer"
- },
- {
- "name": "Elias Häußler",
- "email": "elias@haeussler.dev",
- "homepage": "https://haeussler.dev",
- "role": "Developer"
- },
+ "name": "tritum/form-element-linked-checkbox",
+ "description": "Adds a new form element which allows the editor to create a checkbox with a linked label text. This is an extension for TYPO3 CMS.",
+ "license": "GPL-2.0-or-later",
+ "type": "typo3-cms-extension",
+ "authors": [
+ {
+ "name": "Björn Jacob",
+ "email": "bjoern.jacob@tritum.de",
+ "homepage": "https://www.tritum.de",
+ "role": "Developer"
+ },
{
- "name": "dreistrom.land",
- "email": "hello@dreistrom.land",
- "homepage": "https://dreistrom.land",
- "role": "Developer"
- }
- ],
- "require": {
- "php": "^8.1",
- "typo3/cms-core": "^13.4 || ^14.1",
- "typo3/cms-form": "^13.4 || ^14.1",
- "typo3/cms-frontend": "^13.4 || ^14.1"
- },
- "require-dev": {
- "armin/editorconfig-cli": "^2.2",
- "ergebnis/composer-normalize": "^2.23",
- "helmich/typo3-typoscript-lint": "^3.1",
- "phpstan/phpstan": "^1.3",
- "saschaegerer/phpstan-typo3": "^1.0",
- "typo3/coding-standards": "^0.8.0"
- },
- "autoload": {
- "psr-4": {
- "TRITUM\\FormElementLinkedCheckbox\\": "Classes/"
- }
- },
- "config": {
- "allow-plugins": {
- "ergebnis/composer-normalize": true,
- "typo3/class-alias-loader": true,
- "typo3/cms-composer-installers": true
- },
- "sort-packages": true
- },
- "extra": {
- "typo3/cms": {
- "extension-key": "form_element_linked_checkbox"
- }
- },
- "scripts": {
- "lint": [
- "@lint:editorconfig",
- "@lint:php",
- "@lint:typoscript"
- ],
- "lint:editorconfig": "ec --fix --git-only",
- "lint:php": "php-cs-fixer fix",
- "lint:typoscript": "typoscript-lint -c typoscript-lint.yml",
- "sca": "phpstan analyse -c phpstan.neon"
- }
+ "name": "Elias Häußler",
+ "email": "elias@haeussler.dev",
+ "homepage": "https://haeussler.dev",
+ "role": "Developer"
+ },
+ {
+ "name": "dreistrom.land",
+ "email": "hello@dreistrom.land",
+ "homepage": "https://dreistrom.land",
+ "role": "Developer"
+ }
+ ],
+ "homepage": "https://github.com/tritum/form_element_linked_checkbox",
+ "require": {
+ "php": "^8.1",
+ "typo3/cms-core": "^13.4 || ^14.1",
+ "typo3/cms-form": "^13.4 || ^14.1",
+ "typo3/cms-frontend": "^13.4 || ^14.1"
+ },
+ "require-dev": {
+ "armin/editorconfig-cli": "^2.2",
+ "ergebnis/composer-normalize": "^2.23",
+ "helmich/typo3-typoscript-lint": "^3.1",
+ "phpstan/phpstan": "^1.3",
+ "saschaegerer/phpstan-typo3": "^1.0",
+ "typo3/coding-standards": "^0.8.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "TRITUM\\FormElementLinkedCheckbox\\": "Classes/"
+ }
+ },
+ "config": {
+ "allow-plugins": {
+ "ergebnis/composer-normalize": true,
+ "typo3/class-alias-loader": true,
+ "typo3/cms-composer-installers": true
+ },
+ "sort-packages": true
+ },
+ "extra": {
+ "typo3/cms": {
+ "extension-key": "form_element_linked_checkbox"
+ }
+ },
+ "scripts": {
+ "lint": [
+ "@lint:editorconfig",
+ "@lint:php",
+ "@lint:typoscript"
+ ],
+ "lint:editorconfig": "ec --fix --git-only",
+ "lint:php": "php-cs-fixer fix",
+ "lint:typoscript": "typoscript-lint -c typoscript-lint.yml",
+ "sca": "phpstan analyse -c phpstan.neon"
+ }
}
diff --git a/phpstan.neon b/phpstan.neon
index 498ee12..af251c1 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,7 +1,7 @@
includes:
- - vendor/saschaegerer/phpstan-typo3/extension.neon
+ - vendor/saschaegerer/phpstan-typo3/extension.neon
parameters:
- level: 9
- paths:
- - Classes
- - Configuration
+ level: 9
+ paths:
+ - Classes
+ - Configuration
From 19dbf8e347d8e665328b6b64ee90417eae6f7fec Mon Sep 17 00:00:00 2001
From: Tobias Jungmann <186044798+dreistromland-tj@users.noreply.github.com>
Date: Mon, 23 Feb 2026 13:51:17 +0100
Subject: [PATCH 3/5] [TASK] #SIPACK-306 Update README.md
---
README.md | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index be16cd6..8fe6810 100644
--- a/README.md
+++ b/README.md
@@ -25,9 +25,8 @@ use this template.
1. Require the extension via composer.
2. Add the site set `tritum/form-element-linked-checkbox` to the dependencies
- of your site packages site set (TYPO3 v13).
- Or add the static TypoScript configuration to your TypoScript template
- (TYPO3 v12 and TYPO3 v13).
+ of your site packages site set (recommended).
+ Or add the static TypoScript configuration to your TypoScript template.
## Customization
@@ -137,13 +136,18 @@ the element registration.
| News | TYPO3 | PHP | Notes |
|--------|---------|-----------|-------------------------------------------|
-| master | 12 - 13 | 8.1 - 8.3 | |
+| 6.x | 13 - 14 | 8.2 - 8.5 | Breaking changes. See comments below. |
| 5.x | 12 - 13 | 8.1 - 8.3 | Breaking changes. See comments below. |
| 4.x | 11 - 12 | 7.4 - 8.2 | Breaking changes. See comments below. |
| 3.x | 9 - 11 | 7.2 - 8.1 | Breaking changes. See comments below. |
| 2.x | 9 - 11 | | |
| 1.x | 8 - 9 | | |
+### Breaking changes version 6.x
+
+Version 6.x includes the following breaking changes:
+* [!!!][TASK] Allow TYPO3 v14, drop TYPO3 v12 support [(3448bc5)](https://github.com/dreistromland-tj/form_element_linked_checkbox/commit/3448bc5184f0b0246644a232e128ba21f33e736e)
+
### Breaking changes version 5.x
Version 5.x includes the following breaking changes:
From 0011e3fa7650e81b13bf4e2b3c2032efcedc2c98 Mon Sep 17 00:00:00 2001
From: Tobias Jungmann <186044798+dreistromland-tj@users.noreply.github.com>
Date: Mon, 23 Feb 2026 14:08:05 +0100
Subject: [PATCH 4/5] [TASK] #SIPACK-306 Fix php version in composer.json
---
Classes/Configuration/Extension.php | 2 +-
composer.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Classes/Configuration/Extension.php b/Classes/Configuration/Extension.php
index 25443c0..bf7b5ce 100644
--- a/Classes/Configuration/Extension.php
+++ b/Classes/Configuration/Extension.php
@@ -35,7 +35,7 @@
*/
final class Extension
{
- public const string KEY = 'form_element_linked_checkbox';
+ public const KEY = 'form_element_linked_checkbox';
public static function addTypoScriptSetup(): void
{
diff --git a/composer.json b/composer.json
index c3e3d33..28cb8cd 100644
--- a/composer.json
+++ b/composer.json
@@ -25,7 +25,7 @@
],
"homepage": "https://github.com/tritum/form_element_linked_checkbox",
"require": {
- "php": "^8.1",
+ "php": "^8.2",
"typo3/cms-core": "^13.4 || ^14.1",
"typo3/cms-form": "^13.4 || ^14.1",
"typo3/cms-frontend": "^13.4 || ^14.1"
From d96b2122ca5bc7f32d22b68981a5648814322863 Mon Sep 17 00:00:00 2001
From: Tobias Jungmann <186044798+dreistromland-tj@users.noreply.github.com>
Date: Mon, 23 Feb 2026 14:53:22 +0100
Subject: [PATCH 5/5] [TASK] #SIPACK-306 Add
AfterCurrenPageIsResolvedEventListener
This event listener replaces the form hook in v14. See
- https://docs.typo3.org/c/typo3/cms-core/main/en-us//Changelog/14.0/Breaking-107566-RemovedAfterInitializeCurrentPageHook.html
- https://docs.typo3.org/c/typo3/cms-core/main/en-us//Changelog/14.0/Feature-107566-IntroducePSR14AfterCurrentPageIsResolvedEvent.html#feature-107566-1759226649
---
Classes/Configuration/Extension.php | 5 +
...AfterCurrentPagIsResolvedEventListener.php | 288 ++++++++++++++++++
Classes/Hooks/FormElementLinkResolverHook.php | 2 +-
Configuration/Services.yaml | 8 +
.../Frontend/Partials/LinkedCheckbox.html | 20 +-
.../Frontend/Partials/SummaryPage.html | 15 +-
.../Templates/Finishers/Email/Default.html | 8 +
.../Templates/Finishers/Email/Plaintext.html | 8 +-
composer.json | 2 +-
phpstan.neon | 3 +
10 files changed, 347 insertions(+), 12 deletions(-)
create mode 100644 Classes/EventListener/AfterCurrentPagIsResolvedEventListener.php
create mode 100644 Configuration/Services.yaml
diff --git a/Classes/Configuration/Extension.php b/Classes/Configuration/Extension.php
index bf7b5ce..bae3434 100644
--- a/Classes/Configuration/Extension.php
+++ b/Classes/Configuration/Extension.php
@@ -50,6 +50,11 @@ public static function addTypoScriptSetup(): void
'));
}
+ /**
+ * @todo Remove hook when dropping v13 support.
+ * @see https://docs.typo3.org/c/typo3/cms-core/main/en-us//Changelog/14.0/Breaking-107566-RemovedAfterInitializeCurrentPageHook.html
+ * @see https://docs.typo3.org/c/typo3/cms-core/main/en-us//Changelog/14.0/Feature-107566-IntroducePSR14AfterCurrentPageIsResolvedEvent.html#feature-107566-1759226649
+ */
public static function registerHooks(): void
{
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterInitializeCurrentPage'][1571076908] = FormElementLinkResolverHook::class;
diff --git a/Classes/EventListener/AfterCurrentPagIsResolvedEventListener.php b/Classes/EventListener/AfterCurrentPagIsResolvedEventListener.php
new file mode 100644
index 0000000..6de2d03
--- /dev/null
+++ b/Classes/EventListener/AfterCurrentPagIsResolvedEventListener.php
@@ -0,0 +1,288 @@
+formRuntime = $event->formRuntime;
+ $renderables = $this->formRuntime->getFormDefinition()->getRenderablesRecursively();
+
+ foreach ($renderables as $renderable) {
+ $this->processCharacterSubstitution($renderable);
+ }
+ }
+
+ /**
+ * Resolve link in label of form elements with type LinkedCheckbox.
+ *
+ * @param RootRenderableInterface $renderable
+ */
+ private function processCharacterSubstitution(RootRenderableInterface $renderable): void
+ {
+ // Only process linkText parsing if renderable matches given type
+ if (!($renderable instanceof GenericFormElement) || $renderable->getType() !== $this->type) {
+ return;
+ }
+
+ $label = $this->translate($renderable, ['label']);
+ $properties = $renderable->getProperties();
+
+ // Check if form element label contains any argument flags such as %s.
+ // This also checks if one tries to use the percent sign as regular
+ // character instead of a flag marked for inserting the translated
+ // linkText. It needs to be set as double-percent (%%) substring.
+ // If character substitution is NOT requested, enforce the link to
+ // be prepended to the label text.
+ if (!self::needsCharacterSubstitution($label)) {
+ $label .= ' %s';
+ }
+
+ // Resolve all label arguments and merge them together in order to
+ // use it for later translation of the label. The following
+ // configuration methods are considered:
+ // - "single configuration" via properties pageUid / linkText
+ // - "array configuration" via property "additionalLinks"
+ $singleLinkArgument = $this->buildArgumentFromSingleConfiguration($renderable);
+ $additionalLinkArguments = $this->buildArgumentsFromArrayConfiguration($renderable);
+ $labelArguments = array_merge([$singleLinkArgument], $additionalLinkArguments);
+
+ // Provide translated link as argument for the form element label
+ $renderable->setRenderingOption('translation', [
+ 'arguments' => [
+ 'label' => $labelArguments,
+ ],
+ ]);
+
+ // Run translation again and override final label
+ // (with translated links) as well as it will be used
+ // as default value if no translation is provided
+ $translatedLabel = vsprintf($label, $labelArguments);
+ if (is_string($translatedLabel)) {
+ $renderable->setLabel($translatedLabel);
+ }
+
+ // Reset custom properties in order to avoid additional
+ // link rendering in template
+ $renderable->setProperty('linkText', null);
+ $renderable->setProperty('pageUid', null);
+ $renderable->setProperty('additionalLinks', null);
+
+ // Set fallback value to original property values
+ // to allow other hooks making use of these ones
+ $renderable->setProperty('_label', $label);
+ $renderable->setProperty('_linkText', $singleLinkArgument);
+ $renderable->setProperty('_pageUid', (int)$properties['pageUid']);
+ $renderable->setProperty('_additionalLinks', $additionalLinkArguments);
+ $renderable->setProperty('_linksProcessed', true);
+ }
+
+ /**
+ * Build translation argument for label from single configuration.
+ *
+ * Returns the resolved argument from properties "pageUid" and "linkText"
+ * (default configuration).
+ *
+ * @param GenericFormElement $element
+ *
+ * @return string
+ */
+ private function buildArgumentFromSingleConfiguration(GenericFormElement $element): string
+ {
+ $properties = $element->getProperties();
+ $pageUid = (int)$properties['pageUid'];
+
+ return $this->buildArgument($element, ['linkText'], $pageUid);
+ }
+
+ /**
+ * Build translation arguments for label from array configuration.
+ *
+ * Returns the resolved arguments from property "additionalLinks". The
+ * property consists of a key/value combination of "pageUid"/"linkText".
+ *
+ * @return string[]
+ */
+ private function buildArgumentsFromArrayConfiguration(GenericFormElement $element): array
+ {
+ if (!$this->hasAdditionalLinksConfigured($element)) {
+ return [];
+ }
+
+ $properties = $element->getProperties();
+ $arguments = [];
+
+ foreach ($properties['additionalLinks'] as $pageUid => $linkText) {
+ $arguments[$pageUid] = $this->buildArgument($element, ['additionalLinks', $pageUid], (int)$pageUid);
+ }
+
+ return $arguments;
+ }
+
+ /**
+ * Build translation argument for label from given property path to link text.
+ *
+ * Returns the translation argument for the given property path. The property
+ * path describes the path to the link text for the current argument, whereas
+ * the pageUid describes the actual target page. If the pageUid is valid, this
+ * method returns the generated link, otherwise the translated link text.
+ *
+ * @param GenericFormElement $element
+ * @param string[] $linkTextPropertyPath
+ * @param int $pageUid
+ *
+ * @return string
+ */
+ private function buildArgument(GenericFormElement $element, array $linkTextPropertyPath, int $pageUid): string
+ {
+ $translatedLinkText = $this->translate($element, $linkTextPropertyPath);
+ $additionalLinkConfiguration = $element->getRenderingOptions()['linkConfiguration'] ?? [];
+
+ if ($pageUid <= 0) {
+ return $translatedLinkText;
+ }
+
+ return $this->buildLinkFromPageUid($translatedLinkText, $pageUid, $additionalLinkConfiguration);
+ }
+
+ /**
+ * Check whether renderable has additional links configured.
+ *
+ * Returns `true` if the current renderable has at least one "additional link"
+ * configured (via property "additionalLinks").
+ *
+ * @param GenericFormElement $element
+ *
+ * @return bool
+ */
+ private function hasAdditionalLinksConfigured(GenericFormElement $element): bool
+ {
+ $properties = $element->getProperties();
+
+ return is_array($properties['additionalLinks'] ?? null) && $properties['additionalLinks'] !== [];
+ }
+
+ /**
+ * Translate form element property by given path.
+ *
+ * @param RootRenderableInterface $renderable
+ * @param string[] $propertyPath
+ *
+ * @return string
+ */
+ private function translate(RootRenderableInterface $renderable, array $propertyPath): string
+ {
+ $translationService = GeneralUtility::makeInstance(TranslationService::class);
+ $value = $translationService->translateFormElementValue($renderable, $propertyPath, $this->formRuntime);
+
+ if (!is_string($value)) {
+ return '';
+ }
+
+ return $value;
+ }
+
+ /**
+ * Build typolink from given page UID and additional configuration.
+ *
+ * @param string $linkText
+ * @param int $pageUid
+ * @param array $additionalAttributes
+ *
+ * @return string
+ */
+ private function buildLinkFromPageUid(string $linkText, int $pageUid, array $additionalAttributes = []): string
+ {
+ if (!$pageUid) {
+ return $linkText;
+ }
+
+ // Build typolink configuration from pageUid and additional attributes:
+ // As the pageUid is a necessary part of the parameter configuration,
+ // it cannot be overridden by $additionalAttributes. However one can
+ // provide additional parameter configuration by making use of the
+ // "parameter" key. This way one can disable the default link target
+ // behaviour which falls back to "_blank" by providing an empty
+ // value for the configuration key "parameter" or just setting any
+ // different parameter values according to the TypoScript reference.
+ $parameter = $pageUid . ' ';
+ if (array_key_exists('parameter', $additionalAttributes)) {
+ $parameter .= $additionalAttributes['parameter'];
+ } else {
+ $parameter .= '_blank';
+ }
+ $configuration = [
+ 'typolink.' => [
+ 'parameter' => trim($parameter),
+ 'forceAbsoluteUrl' => true,
+ ],
+ ];
+ if ($additionalAttributes) {
+ unset($additionalAttributes['parameter']);
+ ArrayUtility::mergeRecursiveWithOverrule($configuration['typolink.'], $additionalAttributes);
+ }
+
+ $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
+ $contentObject->start([], '');
+
+ return $contentObject->stdWrap($linkText, $configuration) ?: $linkText;
+ }
+
+ /**
+ * Check whether the given string needs character substitution.
+ *
+ * This method checks whether a given string contains substitution characters (%) which will be used
+ * for character substitution using the `printf()` function. Substitution characters can be escaped
+ * by an additional character (%%) and will be excluded from the check.
+ *
+ * @param string $value String to test for the need of character substitution
+ *
+ * @return bool `true` if character substitution is needed, `false` otherwise
+ * @see printf()
+ */
+ private static function needsCharacterSubstitution(string $value): bool
+ {
+ $filteredValue = $value;
+ do {
+ $filteredValue = str_replace('%%', '', $filteredValue);
+ } while (str_contains($filteredValue, '%%'));
+ return str_contains($filteredValue, '%');
+ }
+}
diff --git a/Classes/Hooks/FormElementLinkResolverHook.php b/Classes/Hooks/FormElementLinkResolverHook.php
index fdc15eb..d8c89f2 100644
--- a/Classes/Hooks/FormElementLinkResolverHook.php
+++ b/Classes/Hooks/FormElementLinkResolverHook.php
@@ -43,7 +43,7 @@ final class FormElementLinkResolverHook
/**
* @var FormRuntime The current form runtime
*/
- private ?FormRuntime $formRuntime = null;
+ private FormRuntime $formRuntime;
/**
* Resolve link in label of form elements with type LinkedCheckbox.
diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml
new file mode 100644
index 0000000..2ad6695
--- /dev/null
+++ b/Configuration/Services.yaml
@@ -0,0 +1,8 @@
+services:
+ _defaults:
+ autowire: true
+ autoconfigure: true
+ public: false
+
+ TRITUM\FormElementLinkedCheckbox\:
+ resource: '../Classes/*'
diff --git a/Resources/Private/Frontend/Partials/LinkedCheckbox.html b/Resources/Private/Frontend/Partials/LinkedCheckbox.html
index 8f4e46d..dc27cb2 100644
--- a/Resources/Private/Frontend/Partials/LinkedCheckbox.html
+++ b/Resources/Private/Frontend/Partials/LinkedCheckbox.html
@@ -1,19 +1,25 @@
-
+
+
+
diff --git a/Resources/Private/Frontend/Partials/SummaryPage.html b/Resources/Private/Frontend/Partials/SummaryPage.html
index cb31738..1b46271 100644
--- a/Resources/Private/Frontend/Partials/SummaryPage.html
+++ b/Resources/Private/Frontend/Partials/SummaryPage.html
@@ -1,4 +1,9 @@
-
+
+
+
diff --git a/Resources/Private/Frontend/Templates/Finishers/Email/Default.html b/Resources/Private/Frontend/Templates/Finishers/Email/Default.html
index 7a96218..20d64aa 100644
--- a/Resources/Private/Frontend/Templates/Finishers/Email/Default.html
+++ b/Resources/Private/Frontend/Templates/Finishers/Email/Default.html
@@ -1,3 +1,9 @@
+
+
{title}
@@ -43,3 +49,5 @@
+
+
diff --git a/Resources/Private/Frontend/Templates/Finishers/Email/Plaintext.html b/Resources/Private/Frontend/Templates/Finishers/Email/Plaintext.html
index 84023cf..aed571b 100644
--- a/Resources/Private/Frontend/Templates/Finishers/Email/Plaintext.html
+++ b/Resources/Private/Frontend/Templates/Finishers/Email/Plaintext.html
@@ -1,4 +1,9 @@
-
+
+
@@ -11,4 +16,5 @@
+
diff --git a/composer.json b/composer.json
index 28cb8cd..b22d5a1 100644
--- a/composer.json
+++ b/composer.json
@@ -63,7 +63,7 @@
"@lint:typoscript"
],
"lint:editorconfig": "ec --fix --git-only",
- "lint:php": "php-cs-fixer fix",
+ "lint:php": "php-cs-fixer fix -v",
"lint:typoscript": "typoscript-lint -c typoscript-lint.yml",
"sca": "phpstan analyse -c phpstan.neon"
}
diff --git a/phpstan.neon b/phpstan.neon
index af251c1..cd2df97 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -5,3 +5,6 @@ parameters:
paths:
- Classes
- Configuration
+ # todo: Remove when dropping v13 support
+ excludePaths:
+ - Classes/EventListener/*