Skip to content

Commit

Permalink
fixed #168 - LinkGenerator not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Fasching committed Jan 23, 2020
1 parent 9d8e598 commit b7c3652
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AppBundle/Website/LinkGenerator/NewsLinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public function generate(Concrete $object, array $params = []): string
$fullPath = substr($document->getFullPath(), strlen($localeUrlPart));
}

if(!$fullPath) {
$fullPath = $document->getProperty('news_default_document') ? substr($document->getProperty('news_default_document')->getFullPath(), strlen($localeUrlPart)) : '';
}

return $this->pimcoreUrl->__invoke(
[
'newstitle' => Text::toUrl($object->getTitle() ? $object->getTitle() : 'news'),
Expand Down

0 comments on commit b7c3652

Please sign in to comment.