From 28e1bd37d09fc10e0a1703c9b96b088c8011aeeb Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 19 Jun 2023 15:51:59 +0100 Subject: [PATCH] MDL-77988 dml: correct logic when dropping plugin tables. Comparison of method void return within a conditional didn't make sense, and the aforementioned method throws an exception on error anyway which would halt execution. --- lib/adminlib.php | 3 ++- lib/upgrade.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index cca2cc34c32..72bb566af67 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -370,7 +370,8 @@ function drop_plugin_tables($name, $file, $feedback=true) { global $CFG, $DB; // first try normal delete - if (file_exists($file) and $DB->get_manager()->delete_tables_from_xmldb_file($file)) { + if (file_exists($file)) { + $DB->get_manager()->delete_tables_from_xmldb_file($file); return true; } diff --git a/lib/upgrade.txt b/lib/upgrade.txt index d1c97007233..b6efd811d69 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -21,6 +21,7 @@ information provided here is intended especially for developers. - `\core\encryption::METHOD_OPENSSL` - `\core\encryption::OPENSSL_CIPHER` * The `\core\encryption::is_sodium_installed` method is deprecated, as Sodium is now a requirement +* The `drop_plugin_tables` method now returns immediately after deleting tables defined by plugin XMLDB file * Support for the following phpunit coverage info properties, deprecated since 3.11, has been removed: - `whitelistfolders` - `whitelistfiles`