Skip to content

Commit

Permalink
db: remove start_url from zoom table
Browse files Browse the repository at this point in the history
  • Loading branch information
smbader committed Nov 16, 2023
1 parent ca6bcd5 commit 9f4ae92
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backup/moodle2/backup_zoom_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion backup/moodle2/restore_zoom_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="false" SEQUENCE="false" COMMENT="Format of description field"/>
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="Maximum grade (points possible) for this activity. Negative value indicates a scale being used."/>
<FIELD NAME="meeting_id" TYPE="int" LENGTH="15" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="start_url" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="join_url" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="created_at" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false" COMMENT="ISO datetime format"/>
<FIELD NAME="host_id" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" COMMENT="Meeting host user ID. Can be any user under this account. Cannot be updated after creation."/>
Expand Down
18 changes: 18 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9f4ae92

Please sign in to comment.