splitbrain / dokuwiki-plugin-bureaucracy

Create forms and generate pages or emails from them
http://www.dokuwiki.org/plugin:bureaucracy
GNU General Public License v2.0
43 stars 47 forks source link

addpage relative path #206

Open cjohnsonuk opened 7 years ago

cjohnsonuk commented 7 years ago

I have a form that creates a policy page called "start" in a namespace named after the policy. I do this so that I can use the struct plugin to match the schema to all pages matching /:policies:docs:.*:start$/ where .* matches the name of the policy I add a number of default tasks to each policy by using the addpage function in bureaucracy to copy a template page to that namespace

<form>
action template templates:policy_page_template :policies:docs:@@policy.PolicyName@@:start
addpage :includes:default_policy_tasks ..:tasks:default_policy_tasks

but its adding the tasks page in :policies:docs:@@policy.PolicyName@@:start:..:tasks:default_policy_tasks

start isn't a namespace its the name of the page but the add page action is treating it like its part of the namespace. It does the same weather I include the leading .. or not or whether I specify the start page name or leave it to the wiki to identify. Using the .. it does not follow normal namespace conventions of going back to the parent of start before creating the tasks. Tasks are in their own namespace so I can exclude them from lists of changed pages etc.

Or at least that's how it behaves on mine... (Bureaucracy Plugin 2017-03-27,Release 2017-02-19b "Frusterick Manners" + many other plugins all up to date as of this post)

Any ideas on how to get add page to miss the start as part of the namespace definition or respect the parent namespace indicator in the path much appreciated?

erdnaxeli commented 4 years ago

It's because how Bureaucracy handles path. It concate the action's target page with the addpage's target, but does not interpert it as you would expect.

I think we need to be able to specify if we want to use an absolute page. So you could do something like this:

action template templates:policy_page_template :policies:docs:@@policy.PolicyName@@:start
addpage :includes:default_policy_tasks :policies:docs:@@policy.PolicyName@@:tasks:default_policy_tasks

This need to things:

edit: for the second point, I actually did it ^^