Hi all,
I have been using bureaucracy in an old dokuwiki (weatherwax) for a few years with no problems.
Now I have installed a recent one (Detritus) and I ran into a strange behaviour.
In my setup I use bureaucracy to generate a couple of namespaces, and each namespace includes a start.txt page, like in
...
action template my-wiki:admin:tpl:mytemplates: userdata:
and inside my-wiki:admin:tpl:mytemplates: I have this structure
public
sidebar.txt
start.txt
private
sidebar.txt
start.txt
When submitting the form, it fails with an error saying
Could not read template "my-wiki:admin:tpl:mytemplates:start". Maybe it doesn't exist or you have no read permissions?
The same configuration worked perfectly in the old (weatherwax) wiki.
After looking and debugging, I found out that if I remove the line shown below in
lib/plugins/bureaucracy/helper/actiontemplate.php
protected function getActionTargetpages($tpl) {
global $USERINFO;
global $conf;
global $ID;
$runas = $this->getConf('runas');
if ($tpl == '_') {
// use namespace template
if (!isset($this->targetpages[$this->pagename])) {
$this->targetpages[$this->pagename] = pageTemplate(array($this->pagename));
}
} elseif ($tpl !== '!') {
$tpl = $this->replace($tpl);
/*resolve_pageid(getNS($ID), $tpl, $ignored);*/ <---------
everything starts working again as expected. The call to resolve_pageid() did not exist in the plugin for the old wiki where things work.
I wonder if this is maybe a flaw in the new version... is the call to resolve_pageid really necessary? What will I miss by removing the call?