Skip to content

Commit

Permalink
Attempts to restore Hogfather compatibility
Browse files Browse the repository at this point in the history
The class PageResolver doesn't exists on DokuWiki Hogfather and older releases, so this PR attempts to fix #291 by falling back to the old function "resolve_id" to parse NS if the class PageResolver isn't available.
  • Loading branch information
eduardomozart authored Feb 1, 2024
1 parent 6936bfc commit 8316f47
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions syntax/indexmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,14 @@ public function parseNs($ns, $id = false)
if ($ns == '..') {
$ns = ":";
}
$ns = "$ns:arandompagehere";
$resolver = new PageResolver($id);
$ns = getNs($resolver->resolveId($ns));
return $ns === false ? '' : $ns;
if (class_exists('dokuwiki\File\PageResolver')) {
$ns = "$ns:arandompagehere";
$resolver = new PageResolver($id);
$ns = getNs($resolver->resolveId($ns));
return $ns === false ? '' : $ns;
} else {
return resolve_id(getNS($id), $ns);
}
}

/**
Expand Down

0 comments on commit 8316f47

Please sign in to comment.