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
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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general resolve_id() should not be used. But I guess the old code did this already…

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the old code already uses this function. I noticed that there's a lot of depreciation errors about IndexMenu plug-in, as it still references "resolve_id" and "resolve_pageid" functions that wasn't migrated to PageResolver yet, so I believe that we migrate all those functions or keep it until we migrate them all.

}
}

/**
Expand Down