Skip to content
Snippets Groups Projects
Commit 9f26a184 authored by Thomas Dondorf's avatar Thomas Dondorf
Browse files

Upgrade script to change customfield added

Also the version increased for this to work.
parent 4c9b64c9
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
function xmldb_local_learning_analytics_upgrade($oldversion) {
global $DB, $CFG;
global $DB, $CFG, $SITE;
// Update TOUR to latest version
if ($oldversion < 2020101301) { // always update this to the latest version when the usertour was changed
......@@ -44,5 +44,16 @@ function xmldb_local_learning_analytics_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2020101301, 'local', 'learning_analytics');
}
if ($oldversion < 2020112600 && ($SITE->shortname === 'RWTHmoodle' || $SITE->shortname === 'L2PTest')) { // TODO set version correct
$statussetting = get_config('local_learning_analytics', 'status');
$customfieldid = (int) get_config('local_learning_analytics', 'customfieldid');
if ($statussetting === 'course_customfield' && !empty($customfieldid)) { // Update the text in RWTHmoodle
$field = \core_customfield\field_controller::create($customfieldid);
$field->set('name', \local_learning_analytics\settings::CUSTOMFIELD_FIELD_NAME);
$field->set('description', \local_learning_analytics\settings::CUSTOMFIELD_FIELD_DESCRIPTION);
$field->save();
}
}
return true;
}
......@@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die;
$plugin->component = 'local_learning_analytics';
$plugin->version = 2020102201;
$plugin->version = 2020112600;
$plugin->release = 'v0.13.0';
$plugin->maturity = MATURITY_BETA;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment