1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 17:54:44 +02:00

Update SystemNotifications module to provide instructions on uninstall requirements, as some have reported the module won't uninstall unless notifications are first disabled.

This commit is contained in:
Ryan Cramer
2021-06-25 13:47:34 -04:00
parent ac626a5794
commit 9ea37575ad
3 changed files with 19 additions and 4 deletions

View File

@@ -422,7 +422,7 @@ class PagesNames extends Wire {
*
* @param string|Page|array $name Name to make unique
* You may optionally substitute the $page argument or $options arguments here, if that is all you need.
* @param Page||string|null|array Page to exclude from duplicate check and/or to pull $name or parent from (if not otherwise specified).
* @param Page|string|null|array Page to exclude from duplicate check and/or to pull $name or parent from (if not otherwise specified).
* Note that specifying a Page is important if the page already exists, as it is used as the page to exclude when checking for
* name collisions, and we want to exclude $page from that check. You may optionally substitute the $options or $name arguments
* here, if that is all you need. If $parent or $name are specified separately from this $page argument, they will override

View File

@@ -111,10 +111,23 @@ class SystemNotifications extends WireData implements Module {
}
}
if($page->template == 'admin' && !$this->wire('input')->get('modal')) {
if($page->template == 'admin') {
if(!$this->wire('input')->get('modal')) {
$this->addHookAfter('AdminTheme::getExtraMarkup', $this, 'hookAdminThemeGetExtraMarkup');
}
if($page->process == 'ProcessModule' && !$this->disabled) {
$this->wire()->modules->addHookAfter('isUninstallable', function(HookEvent $event) {
$class = $event->arguments(0);
if($class !== $this->className()) return;
$returnReason = $event->arguments(1);
if($returnReason) {
$event->return = 'You must set “Notification status” to “Off” before uninstalling.';
} else {
$event->return = false;
}
});
}
}
}
/**

View File

@@ -3,6 +3,8 @@
/**
* Configuration class for the SystemNotifications module
*
* @property string $systemUserName
*
*/
class SystemNotificationsConfig extends ModuleConfig {