Skip to content

Commit

Permalink
[BUGFIX] DatabaseRecordLinkBuilder respect now other typoscript settings
Browse files Browse the repository at this point in the history
If typolinks are generated using LinkHandler, the values defined in
typoscript (such as classes and titles) are now retained.

Resolves: #81903
Releases: master, 8.7
Change-Id: I9ec63e2cf972a3c4e7439b9259c63e2ab9b4b60d
Reviewed-on: https://review.typo3.org/55426
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
rpflamm authored and lolli42 committed Mar 8, 2018
1 parent a388232 commit 7fb4977
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -34,7 +34,7 @@ public function build(array &$linkDetails, string $linkText, string $target, arr
$configuration = $tsfe->tmpl->setup['config.']['recordLinks.'];
$linkHandlerConfiguration = $pageTsConfig['TCEMAIN.']['linkHandler.'];

if (!isset($configuration[$configurationKey]) || !isset($linkHandlerConfiguration[$configurationKey])) {
if (!isset($configuration[$configurationKey], $linkHandlerConfiguration[$configurationKey])) {
throw new UnableToLinkException(
'Configuration how to link "' . $linkDetails['typoLinkParameter'] . '" was not found, so "' . $linkText . '" was not linked.',
1490989149,
Expand All @@ -59,6 +59,11 @@ public function build(array &$linkDetails, string $linkText, string $target, arr
);
}

// Unset the parameter part of the given TypoScript configuration while keeping
// config that has been set in addition.
unset($conf['parameter.']);
$typoScriptConfiguration = array_merge_recursive($typoScriptConfiguration, $conf);

// Build the full link to the record
$localContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
$localContentObjectRenderer->start($record, $linkHandlerConfiguration['table']);
Expand Down

0 comments on commit 7fb4977

Please sign in to comment.