[BUGFIX] Respect config.intTarget and extTarget in default ParseFunc 84/62184/3
authorBenni Mack <benni@typo3.org>
Mon, 4 Nov 2019 20:38:49 +0000 (21:38 +0100)
committerDaniel Goerz <daniel.goerz@posteo.de>
Sun, 17 Nov 2019 15:15:13 +0000 (16:15 +0100)
Fluid Styled Content's "lib.parseFunc" always sets the extTarget (target for
external URLs) to the constant, but never considers config.extTarget anymore.

Same goes for the internal target, where target is never set, as
the target parameter is already filled.

The patch adds some minor inline information as well as
the proper values.

In the future, it would make sense to use the same target values
for config.*target (which is for ALL links and not just the ones in parseFunc)
which should be populated by the constants, and not have the constants
interfer into lib.parseFunc anymore.

Resolves: #88325
Releases: master, 9.5
Change-Id: Ibfa6578900f167ea465476865c67064878e31bac
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62184
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>

index 0793a6f..fb02da7 100644 (file)
@@ -18,8 +18,12 @@ lib.parseFunc {
                 parameter.data = parameters:href
                 title.data = parameters:title
                 ATagParams.data = parameters:allParams
-                target.data = parameters:target
-                extTarget = {$styles.content.links.extTarget}
+                # the target attribute takes precedence over config.intTarget
+                target.ifEmpty.data = parameters:target
+                # the target attribute takes precedence over the constant (styles.content.links.extTarget)
+                # which takes precedence over config.extTarget
+                extTarget.ifEmpty =< config.extTarget
+                extTarget.ifEmpty.override = {$styles.content.links.extTarget}
                 extTarget.override.data = parameters:target