diff --git a/README.md b/README.md index cc30d8d..0478bdf 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,7 @@ Download the latest release from [Tags] page and install the plugin using the 1. Create an Incoming Webhook on slack: https://api.slack.com/messaging/webhooks#create_a_webhook 2. Enter the webhook into the slacknotifier configuration section in DokuWiki's Configuration Settings + +## Root Namespace + +To include the root namespace, simply put a `:` in the namespace field in the config. diff --git a/event/PageSaveEvent.php b/event/PageSaveEvent.php index 682d3b7..b345395 100644 --- a/event/PageSaveEvent.php +++ b/event/PageSaveEvent.php @@ -34,6 +34,12 @@ public function getEventType(): ?string */ public function getNamespace(): string { + // Handle special case of page being in root namespace + $pos = strpos($this->id, ':'); + if ($pos === false) { + return ':'; + } + return explode(':', $this->id, 2)[0]; }