From 9f4ae92c3fe02b517609659070d95d20794c3c50 Mon Sep 17 00:00:00 2001 From: Steve Bader Date: Thu, 16 Nov 2023 10:55:14 -0500 Subject: [PATCH 1/3] 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; From 4dc545fe02d8fe01a47ddeed7c4c746a3022b0d0 Mon Sep 17 00:00:00 2001 From: Steve Bader Date: Thu, 16 Nov 2023 11:08:26 -0500 Subject: [PATCH 2/3] ci: comment must end in full stop --- db/upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/upgrade.php b/db/upgrade.php index 0fdc717d..b91c7428 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -916,7 +916,7 @@ function xmldb_zoom_upgrade($oldversion) { } if ($oldversion < 2023111600) { - // Issue #326: Drop start_url from database + // Issue #326: Drop start_url from database. // Start zoom table modifications. $table = new xmldb_table('zoom'); From ea4b112b3aa8249616d7f321a33704471737dd5d Mon Sep 17 00:00:00 2001 From: Steve Bader Date: Thu, 16 Nov 2023 14:09:36 -0500 Subject: [PATCH 3/3] db: export via xmldb editor --- db/install.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 db/install.xml diff --git a/db/install.xml b/db/install.xml old mode 100755 new mode 100644 index 175b0513..2c67b348 --- a/db/install.xml +++ b/db/install.xml @@ -1,5 +1,5 @@ -