Skip to content

Commit

Permalink
BugFix: Delay options filed improved.
Browse files Browse the repository at this point in the history
- CD-346
  • Loading branch information
abinesh-lmsace committed Jan 6, 2025
1 parent 36e7f66 commit d97900a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/form/general_element_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function standard_element_settings($mform) {
$mform->setDefault('duration', $default ?: 'slow');

$mform->addElement('text', 'delay', get_string('strdelay', 'mod_contentdesigner'));
$mform->setType('delay', PARAM_INT);
$mform->setType('delay', PARAM_TEXT);
$mform->addHelpButton('delay', 'strdelay', 'mod_contentdesigner');
$default = get_config('mod_contentdesigner', 'delay');
$mform->setDefault('delay', $default ?: '');
Expand Down
2 changes: 1 addition & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<FIELD NAME="belowcolorbg" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="animation" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="duration" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="delay" TYPE="int" LENGTH="18" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="delay" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="direction" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="speed" TYPE="int" LENGTH="9" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="viewport" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false"/>
Expand Down
17 changes: 15 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,20 @@
* @return bool True on success.
*/
function xmldb_contentdesigner_upgrade($oldversion) {
// Automatically generated Moodle v4.4.0 release upgrade line.
// Put any upgrade step following this.
global $DB;

$dbman = $DB->get_manager();

if ($oldversion < 2024110807) {
$optionstable = new xmldb_table('contentdesigner_options');
$delay = new xmldb_field('delay', XMLDB_TYPE_CHAR, '10', null, null, null, '0', 'duration');
if ($dbman->field_exists($optionstable, $delay)) {
$dbman->change_field_type($optionstable, $delay);
}

upgrade_mod_savepoint(true, 2024110807, 'contentdesigner');
}

return true;

}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

defined('MOODLE_INTERNAL') || die();
$plugin->version = 2024110806; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2024110807; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2020061500; // Requires this Moodle version.
$plugin->component = 'mod_contentdesigner'; // Full name of the plugin (used for diagnostics).
$plugin->release = 'v1.1';
Expand Down

0 comments on commit d97900a

Please sign in to comment.