diff --git a/src/UI/Implementation/Component/MainControls/Renderer.php b/src/UI/Implementation/Component/MainControls/Renderer.php index c1b965540632..9fcb9e3ddd97 100644 --- a/src/UI/Implementation/Component/MainControls/Renderer.php +++ b/src/UI/Implementation/Component/MainControls/Renderer.php @@ -15,6 +15,7 @@ use ILIAS\UI\Implementation\Component\Button\Bulky as IBulky; use ILIAS\UI\Implementation\Component\MainControls\Slate\Slate as ISlate; use ILIAS\UI\Implementation\Render\Template as UITemplateWrapper; +use ILIAS\Data\URI; class Renderer extends AbstractComponentRenderer { @@ -370,10 +371,20 @@ protected function renderFooter(Footer $component, RendererInterface $default_re $tpl->setVariable('TEXT', $component->getText()); $perm_url = $component->getPermanentURL(); - if ($perm_url) { - $url = $perm_url->getBaseURI() . '?' . $perm_url->getQuery(); + if ($perm_url instanceof URI) { + // Since URI::__toString() is only available in ILIAS >= 7 we have to do that on our own... + $uri = $perm_url->getBaseURI(); + $query = $perm_url->getQuery(); + if ($query) { + $uri .= '?' . $query; + } + $fragment = $perm_url->getFragment(); + if ($fragment) { + $uri .= '#' . $fragment; + } + $tpl->setVariable('PERMA_LINK_LABEL', $this->txt('perma_link')); - $tpl->setVariable('PERMANENT_URL', $url); + $tpl->setVariable('PERMANENT_URL', $uri); } return $tpl->get(); }