From 48403016b83a31516d6356aced1c1f339ab169a3 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Wed, 1 Oct 2025 08:10:48 +0200 Subject: [PATCH 1/3] Fix(Core): Fix plugin name label --- setup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.php b/setup.php index 411fa3cb..4f76d272 100644 --- a/setup.php +++ b/setup.php @@ -129,7 +129,7 @@ function plugin_init_genericobject() function plugin_version_genericobject() { return [ - 'name' => __s("Objects management (Migration Only)", "genericobject"), + 'name' => __s("Generic Objects End-of-Life Updater", "genericobject"), 'version' => PLUGIN_GENERICOBJECT_VERSION, 'author' => "Teclib' & siprossii", 'homepage' => 'https://github.com/pluginsGLPI/genericobject', From fc3ea921b265a41a154658f69e45deb47a080d03 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Wed, 1 Oct 2025 08:35:37 +0200 Subject: [PATCH 2/3] fix uninstall --- inc/profile.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/profile.class.php b/inc/profile.class.php index f8dd7e82..8f7a8e4f 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -121,6 +121,8 @@ public static function uninstall() { /** @var DBmysql $DB */ global $DB; - $DB->dropTable('glpi_profilerights'); + $query = "DELETE FROM `glpi_profilerights` + WHERE `name` LIKE '%plugin_genericobject%'"; + $DB->doQuery($query); } } From 9cbd3e133fdd6ade2d63ce1ba29e258eafb81d49 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Wed, 1 Oct 2025 08:50:14 +0200 Subject: [PATCH 3/3] secure drop table --- inc/type.class.php | 4 +++- inc/typefamily.class.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/type.class.php b/inc/type.class.php index 376616a1..edcba754 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -654,6 +654,8 @@ public static function uninstall() /** @var DBmysql $DB */ global $DB; + $migration = new Migration(PLUGIN_GENERICOBJECT_VERSION); + //Delete references to PluginGenericobjectType in the following tables self::deleteItemtypeReferencesInGLPI(self::class); @@ -665,7 +667,7 @@ public static function uninstall() } //Delete table - $DB->dropTable('glpi_plugin_genericobject_types', true); + $migration->dropTable('glpi_plugin_genericobject_types'); } diff --git a/inc/typefamily.class.php b/inc/typefamily.class.php index 364c6561..f7ebce06 100644 --- a/inc/typefamily.class.php +++ b/inc/typefamily.class.php @@ -71,7 +71,8 @@ public static function uninstall() /** @var DBmysql $DB */ global $DB; + $migration = new Migration(PLUGIN_GENERICOBJECT_VERSION); $table = getTableForItemType(self::class); - $DB->dropTable($table, true); + $migration->dropTable($table); } }