From 2cecf54a320156e61ce8a975dc66f63d1f88977c Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 7 Feb 2024 22:49:00 +0100 Subject: [PATCH] fix warnings if on page without navigation --- syntax/toc.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/syntax/toc.php b/syntax/toc.php index 74d6fec..c468479 100644 --- a/syntax/toc.php +++ b/syntax/toc.php @@ -217,6 +217,7 @@ public function render($format, Doku_Renderer $renderer, $options) } } else { $pagedata = p_get_metadata($pageid, 'docnavigation'); + //can be null if on page without navigation. } //check referer @@ -229,14 +230,16 @@ public function render($format, Doku_Renderer $renderer, $options) } $previouspage = $pageid; - $nextpageid = $pagedata['next']['link']; - if (empty($nextpageid)) { + if (empty($pagedata['next']['link'])) { $pageid = null; - } elseif ($options['hidepagelink'] ? isset($recursioncheck[$nextpageid]) : isset($list[$nextpageid])) { - msg(sprintf($this->getLang('recursionprevented'), $pageid, $nextpageid), -1); - $pageid = null; - } else { - $pageid = $nextpageid; + } else{ + $nextpageid = $pagedata['next']['link']; + if ($options['hidepagelink'] ? isset($recursioncheck[$nextpageid]) : isset($list[$nextpageid])) { + msg(sprintf($this->getLang('recursionprevented'), $pageid, $nextpageid), -1); + $pageid = null; + } else { + $pageid = $nextpageid; + } } }