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:
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -3,6 +3,8 @@
|
||||
/**
|
||||
* Configuration class for the SystemNotifications module
|
||||
*
|
||||
* @property string $systemUserName
|
||||
*
|
||||
*/
|
||||
|
||||
class SystemNotificationsConfig extends ModuleConfig {
|
||||
|
Reference in New Issue
Block a user