diff --git a/CHANGELOG.md b/CHANGELOG.md index cd7603e..83dc01d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [UNRELEASED] +## [unreleased] ### Fixed diff --git a/inc/profile.class.php b/inc/profile.class.php index 9cb7331..c2c2a90 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -38,7 +38,7 @@ class PluginUninstallProfile extends Profile * * @return array rights matrix */ - public function getGeneralRights() + public static function getGeneralRights() { return [ [ @@ -71,7 +71,7 @@ public function showForm($ID, $options = []) $this->showFormHeader($options); } - $rights = $this->getGeneralRights(); + $rights = self::getGeneralRights(); $profile->displayRightsChoiceMatrix($rights, ['canedit' => $canedit, 'default_class' => 'tab_bg_2', ]); @@ -304,5 +304,11 @@ public static function uninstall() global $DB; $DB->doQuery("DROP TABLE IF EXISTS `" . getTableForItemType(self::class) . "`"); + + foreach (self::getGeneralRights() as $right) { + ProfileRight::deleteProfileRights([$right['field']]); + } + + ProfileRight::deleteProfileRights(['plugin_uninstall_replace']); } }