From 9f4ae92c3fe02b517609659070d95d20794c3c50 Mon Sep 17 00:00:00 2001 From: Steve Bader Date: Thu, 16 Nov 2023 10:55:14 -0500 Subject: [PATCH] db: remove start_url from zoom table --- backup/moodle2/backup_zoom_stepslib.php | 2 +- backup/moodle2/restore_zoom_stepslib.php | 1 - db/install.xml | 1 - db/upgrade.php | 18 ++++++++++++++++++ lib.php | 2 +- version.php | 2 +- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/backup/moodle2/backup_zoom_stepslib.php b/backup/moodle2/backup_zoom_stepslib.php index 3d82e2e4..6442c49a 100644 --- a/backup/moodle2/backup_zoom_stepslib.php +++ b/backup/moodle2/backup_zoom_stepslib.php @@ -40,7 +40,7 @@ class backup_activity_structure_step extends \backup_activity_structure_step { protected function define_structure() { // Define the root element describing the zoom instance. $zoom = new backup_nested_element('zoom', ['id'], [ - 'intro', 'introformat', 'grade', 'meeting_id', 'start_url', 'join_url', 'created_at', 'host_id', 'name', + 'intro', 'introformat', 'grade', 'meeting_id', 'join_url', 'created_at', 'host_id', 'name', 'start_time', 'timemodified', 'recurring', 'recurrence_type', 'repeat_interval', 'weekly_days', 'monthly_day', 'monthly_week', 'monthly_week_day', 'monthly_repeat_option', 'end_times', 'end_date_time', 'end_date_option', 'webinar', 'duration', 'timezone', 'password', 'option_jbh', 'option_start_type', 'option_host_video', diff --git a/backup/moodle2/restore_zoom_stepslib.php b/backup/moodle2/restore_zoom_stepslib.php index 8997bc47..599fed1d 100755 --- a/backup/moodle2/restore_zoom_stepslib.php +++ b/backup/moodle2/restore_zoom_stepslib.php @@ -69,7 +69,6 @@ protected function process_zoom($data) { $data = populate_zoom_from_response($data, $updateddata); $data->exists_on_zoom = ZOOM_MEETING_EXISTS; } catch (moodle_exception $e) { - $data->start_url = ''; $data->join_url = ''; $data->meeting_id = 0; $data->exists_on_zoom = ZOOM_MEETING_EXPIRED; diff --git a/db/install.xml b/db/install.xml index c12120c7..175b0513 100755 --- a/db/install.xml +++ b/db/install.xml @@ -12,7 +12,6 @@ - diff --git a/db/upgrade.php b/db/upgrade.php index 3e6c577c..0fdc717d 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -915,5 +915,23 @@ function xmldb_zoom_upgrade($oldversion) { upgrade_mod_savepoint(true, 2023080202, 'zoom'); } + if ($oldversion < 2023111600) { + // Issue #326: Drop start_url from database + + // Start zoom table modifications. + $table = new xmldb_table('zoom'); + + // Define field status to be dropped from zoom. + $field = new xmldb_field('start_url'); + + // Conditionally launch drop field status. + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + // Zoom savepoint reached. + upgrade_mod_savepoint(true, 2023111600, 'zoom'); + } + return true; } diff --git a/lib.php b/lib.php index 9a3c9a78..0a02ff36 100755 --- a/lib.php +++ b/lib.php @@ -277,7 +277,7 @@ function populate_zoom_from_response(stdClass $zoom, stdClass $response) { $newzoom = clone $zoom; - $samefields = ['start_url', 'join_url', 'created_at', 'timezone']; + $samefields = ['join_url', 'created_at', 'timezone']; foreach ($samefields as $field) { if (isset($response->$field)) { $newzoom->$field = $response->$field; diff --git a/version.php b/version.php index 164cabfe..17389111 100755 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_zoom'; -$plugin->version = 2023111000; +$plugin->version = 2023111600; $plugin->release = 'v5.1.2'; $plugin->requires = 2019052000; $plugin->maturity = MATURITY_STABLE;