Skip to content

Commit

Permalink
Merge pull request #52 from devmes/fix/patch-49
Browse files Browse the repository at this point in the history
fix(AfterLinkIsGenereatedEvent): Loads TypScriptFrontendController at the beginning
  • Loading branch information
bmack authored Apr 3, 2024
2 parents 9c2a2c6 + 6637da5 commit ec0d529
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Classes/TypoLink/LinkModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ class LinkModifier

public function __invoke(AfterLinkIsGeneratedEvent $event): void
{
$this->contentObjectRenderer = $event->getContentObjectRenderer();
$this->frontendController = $this->contentObjectRenderer->getTypoScriptFrontendController();

if ($this->isEnabled($event)) {
$url = $event->getLinkResult()->getUrl();
$context = $event->getLinkResult()->getType();
$configuration = $event->getLinkResult()->getLinkConfiguration();
$this->contentObjectRenderer = $event->getContentObjectRenderer();
$this->frontendController = $this->contentObjectRenderer->getTypoScriptFrontendController();

// Strip the absRefPrefix from the URLs.
$urlPrefix = (string)$this->getTypoScriptFrontendController()->absRefPrefix;
Expand Down

0 comments on commit ec0d529

Please sign in to comment.