From a1c1c23c45e1aa200de377a975a8faaa4bdf07ac Mon Sep 17 00:00:00 2001 From: vv221 Date: Fri, 3 Apr 2020 00:56:58 +0200 Subject: [PATCH] Only take action if the current page is not included in a namespace This is to avoid recursive children pages creation, a future update will handle this in a smarter way. --- action.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.php b/action.php index ee45cbc..2d54d5b 100644 --- a/action.php +++ b/action.php @@ -27,6 +27,7 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin { * @param Doku_Event $event */ public function addMenuItem(Doku_Event $event) : void { + global $INFO; // Check that this method has been called in the expected context if ( $event->name !== 'MENU_ITEMS_ASSEMBLY' ) { $message = "Tabpage plugin error:"; @@ -38,6 +39,10 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin { if ( $event->data['view'] !== 'page' ) { return; } + // Only add links if the current page is not included in a namespace + if ( ! empty($INFO['namespace']) ) { + return; + } trigger_error('addMenuItem() not implemented in '.get_class($this), E_USER_WARNING); } }