Skip to content

Commit

Permalink
[#326] change field referer to text
Browse files Browse the repository at this point in the history
  • Loading branch information
jwalits committed Aug 29, 2023
1 parent 1c5bbe2 commit 07885d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions db/install.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="admin/tool/excimer/db" VERSION="20230216" COMMENT="XMLDB file for Moodle admin/tool/excimer"
<XMLDB PATH="admin/tool/excimer/db" VERSION="20230829" COMMENT="XMLDB file for Moodle admin/tool/excimer"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
>
Expand All @@ -23,7 +23,7 @@
<FIELD NAME="cookies" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Are any cookies set?"/>
<FIELD NAME="buffering" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Is buffering set?"/>
<FIELD NAME="responsecode" TYPE="int" LENGTH="3" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="HTTP response code, or 0/1 for command line"/>
<FIELD NAME="referer" TYPE="char" LENGTH="256" NOTNULL="true" SEQUENCE="false" COMMENT="Refering URL, if any"/>
<FIELD NAME="referer" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Refering URL, if any"/>
<FIELD NAME="pid" TYPE="int" LENGTH="11" NOTNULL="true" SEQUENCE="false" COMMENT="Process ID"/>
<FIELD NAME="hostname" TYPE="char" LENGTH="256" NOTNULL="true" SEQUENCE="false" COMMENT="Host name (empty for CLI scripts)"/>
<FIELD NAME="useragent" TYPE="char" LENGTH="256" NOTNULL="true" SEQUENCE="false" COMMENT="User agent (empty for CLI scripts)"/>
Expand Down
15 changes: 15 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,20 @@ function xmldb_tool_excimer_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2023050800, 'tool', 'excimer');
}

if ($oldversion < 2023082900) {

// Define field id to be added to tool_excimer_profiles.
$table = new xmldb_table('tool_excimer_profiles');
$field = new xmldb_field('referer', XMLDB_TYPE_TEXT, null, null, false);

// Conditionally change the referer field.
if ($dbman->field_exists($table, $field)) {
$dbman->change_field_default($table, $field);
}

// Excimer savepoint reached.
upgrade_plugin_savepoint(true, 2023082900, 'tool', 'excimer');
}

return true;
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023060200;
$plugin->release = 2023060200;
$plugin->version = 2023082900;
$plugin->release = 2023082900;
$plugin->requires = 2017051500; // Moodle 3.3 for Totara support.
$plugin->supported = [35, 401]; // Supports Moodle 3.5 or later.
// TODO $plugin->incompatible = ; // Available as of Moodle 3.9.0 or later.
Expand Down

0 comments on commit 07885d5

Please sign in to comment.