1
0
Fork 0

Fix uninstall of installed addons

This commit is contained in:
Michael 2020-03-09 23:28:37 +00:00
commit 8e421f0893
4 changed files with 30 additions and 100 deletions

View file

@ -92,23 +92,10 @@ function update_1191()
DI::config()->set('system', 'maintenance', 1);
if (Addon::isEnabled('forumlist')) {
$addon = 'forumlist';
$addons = DI::config()->get('system', 'addon');
$addons_arr = [];
if ($addons) {
$addons_arr = explode(",", str_replace(" ", "", $addons));
$idx = array_search($addon, $addons_arr);
if ($idx !== false) {
unset($addons_arr[$idx]);
//delete forumlist manually from addon and hook table
// since Addon::uninstall() don't work here
q("DELETE FROM `addon` WHERE `name` = 'forumlist' ");
q("DELETE FROM `hook` WHERE `file` = 'addon/forumlist/forumlist.php' ");
DI::config()->set('system', 'addon', implode(", ", $addons_arr));
}
}
//delete forumlist manually from addon and hook table
// since Addon::uninstall() don't work here
DBA::delete('addon', ['name' => 'forumlist']);
DBA::delete('hook', ['file' => 'addon/forumlist/forumlist.php']);
}
// select old formlist addon entries