From 9ac0d59c66290ef226877f2f3cbf1137c1e3c0ce Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Mon, 14 Jun 2021 12:18:40 +0200 Subject: [PATCH] Leave table deletion to FreePBX FreePBX and Director remove all tables that it has installed. If they do not exist, uninstaller gives errors --- uninstall.php | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/uninstall.php b/uninstall.php index c4c7956..b1375b6 100644 --- a/uninstall.php +++ b/uninstall.php @@ -95,21 +95,15 @@ if (!empty($version)) { sql("DELETE FROM kvstore WHERE module = 'sccpsettings'"); sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'"); } -} -outn("
  • " . _('Removing all Sccp_manager tables') . "
  • "); -foreach ($sqlTables as $table) { - $sql = "DROP TABLE IF EXISTS {$table}"; - $result = $db->query($sql); - if (DB::IsError($result)) { - die_freepbx($result->getDebugInfo()); - } - $sql = "DROP VIEW IF EXISTS sccpdeviceconfig"; - $result = $db->query($sql); - if (DB::IsError($result)) { - die_freepbx($result->getDebugInfo()); - } - unset($result); -} - outn("
  • " . _("Uninstall Complete") . "
  • "); - return true; + } + // FreePbx removes all tables via module.xml, and uninstaller will error + // If the tables do not exist. + //outn("
  • " . _('Removing all Sccp_manager tables') . "
  • "); + //foreach ($sqlTables as $table) { + //$sql = "DROP TABLE IF EXISTS {$table}"; + //} + outn("
  • " . _('Removing all Sccp_manager views') . "
  • "); + $db->query("DROP VIEW IF EXISTS sccpdeviceconfig"); + + outn("
  • " . _("Uninstall Complete") . "
  • "); ?>