Skip to content

Commit

Permalink
Replace deprecated resolve_pageid()
Browse files Browse the repository at this point in the history
Use the PageResolver class instead, as documented [1].

Fixes #95

[1]: https://www.dokuwiki.org/devel:releases:refactor2021#refactoring_of_id_resolving
  • Loading branch information
dregad committed May 10, 2023
1 parent 7c0b9c8 commit 51a509d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*/

// must be run within Dokuwiki
use dokuwiki\File\PageResolver;

if(!defined('DOKU_INC')) die();

class syntax_plugin_addnewpage extends DokuWiki_Syntax_Plugin {
Expand Down Expand Up @@ -309,10 +311,7 @@ protected function _parseNSTemplatePage($nstemplate) {
global $ID;

@list($template, $name) = explode('|', $nstemplate, 2);

$exist = null;
resolve_pageid(getNS($ID), $template, $exist); //get absolute id

$template = (new PageResolver($ID))->resolveId($template);
if (is_null($name)) $name = $template;

return array($template, $name);
Expand Down

0 comments on commit 51a509d

Please sign in to comment.