diff --git a/db/upgrade.php b/db/upgrade.php index 3c461d15f587f4d3a91bef93570c1adb4b3125c0..cd13857b5fc1f3fd1550dbdcaeda70af66e6041c 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -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; } diff --git a/version.php b/version.php index 67f47d442c5d0fdb348e39433693b30a32464cfb..960a06ea1f1b96b8d5ce226ebb50035e428ba156 100644 --- a/version.php +++ b/version.php @@ -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;