If I add a link in let's say a RTE editor the css classes, title attribute and so on are ignored when the link is rendered in the FE. I think this is because HDNET\Calendarize\Typolink\DatabaseRecordLinkBuilder doesn't take care of that in contrast to TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder.
Is there a reason why the building of the typolink is done in HDNET\Calendarize\Typolink\DatabaseRecordLinkBuilder instead of delegating it to TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder ? I think in HDNET\Calendarize\Typolink\DatabaseRecordLinkBuilder::build() everything after building the TypoScript configuration can be removed and replaced by simply providing the TypoScript configuration like TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder expects it and leaving the rest to TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder::build(). The code looks like this in the moment:
$localContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
$localContentObjectRenderer->parameters = $this->contentObjectRenderer->parameters;
$link = $localContentObjectRenderer->typoLink($linkText, $typoScriptConfiguration);
$this->contentObjectRenderer->lastTypoLinkLD = $localContentObjectRenderer->lastTypoLinkLD;
$this->contentObjectRenderer->lastTypoLinkUrl = $localContentObjectRenderer->lastTypoLinkUrl;
$this->contentObjectRenderer->lastTypoLinkTarget = $localContentObjectRenderer->lastTypoLinkTarget;
// nasty workaround so typolink stops putting a link together, there is a link already built
throw new UnableToLinkException('', 1491130170, null, $link);
If I add a link in let's say a RTE editor the css classes, title attribute and so on are ignored when the link is rendered in the FE. I think this is because HDNET\Calendarize\Typolink\DatabaseRecordLinkBuilder doesn't take care of that in contrast to TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder.
Is there a reason why the building of the typolink is done in HDNET\Calendarize\Typolink\DatabaseRecordLinkBuilder instead of delegating it to TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder ? I think in HDNET\Calendarize\Typolink\DatabaseRecordLinkBuilder::build() everything after building the TypoScript configuration can be removed and replaced by simply providing the TypoScript configuration like TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder expects it and leaving the rest to TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder::build(). The code looks like this in the moment:
It could be changed to this I think:
It seems like the links are still built correct and on top the attributes from the link browser are taken into account now.
What do you think about that change? I can provide a PR if you like.