Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions action/rendertoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ function handlePostProcess(Doku_Event $event, $param) {
return;
}

// Skip processing for non-existent pages to prevent PHP 8.3 TypeError
if (!page_exists($INFO['id'])) {
return;
}

// TOC Position check
$tocPosition = @$meta['position'] ?: $this->getConf('tocPosition');
if ($ACT == 'preview') {
Expand Down Expand Up @@ -175,6 +180,11 @@ function handleTocRender(Doku_Event $event, $param) {
return;
}

// Skip processing for non-existent pages to prevent PHP 8.3 TypeError
if (!page_exists($INFO['id'])) {
return;
}

// retrieve toc config parameters from metadata
$topLv = @$meta['toptoclevel'] ?: $this->getConf('toptoclevel');
$maxLv = @$meta['maxtoclevel'] ?: $this->getConf('maxtoclevel');
Expand Down Expand Up @@ -204,6 +214,11 @@ function handleContentDisplay(Doku_Event $event, $param) {
return;
}

// Skip processing for non-existent pages to prevent PHP 8.3 TypeError
if (!page_exists($INFO['id'])) {
return;
}

// TOC Position check
$tocPosition = @$meta['position'] ?: $this->getConf('tocPosition');
if (!in_array($tocPosition, [0,1,2,6])) {
Expand Down