Skip to content

Commit

Permalink
Merge pull request #546 from smbader/issue_326
Browse files Browse the repository at this point in the history
db: remove start_url from zoom table
  • Loading branch information
jrchamp authored Nov 30, 2023
2 parents ca6bcd5 + ea4b112 commit 3cd1bfe
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 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
3 changes: 1 addition & 2 deletions db/install.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/zoom/db" VERSION="20230803" COMMENT="Zoom module"
<XMLDB PATH="mod/zoom/db" VERSION="20231116" COMMENT="Zoom module"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
Expand All @@ -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 3cd1bfe

Please sign in to comment.