From 6d6a83e91d132386c6c203f44f282dc35268a0f0 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Mon, 18 Feb 2019 16:30:19 +0100 Subject: [PATCH] MDL-64314 messaging: Quick fix for empty insights configuration. --- lib/db/upgrade.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index d3a2ff8fdb9..e9bbae58f7c 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2721,8 +2721,10 @@ function xmldb_main_upgrade($oldversion) { if ($oldversion < 2019021500.01) { $insights = $DB->get_record('message_providers', ['component' => 'moodle', 'name' => 'insights']); - $insights->capability = null; - $DB->update_record('message_providers', $insights); + if (!empty($insights)) { + $insights->capability = null; + $DB->update_record('message_providers', $insights); + } upgrade_main_savepoint(true, 2019021500.01); } -- 2.43.0