MDL-53451 tool_lpmigrate: Keep course competency on module failure

When permissions are lacking and the course module competencies could
not be migrated we must keep the course competency to preserve the
original competency in the course module.
This commit is contained in:
Frederic Massart
2016-04-21 11:40:36 +08:00
parent 8ef18bda2b
commit 3577bbe101
2 changed files with 10 additions and 3 deletions
@@ -543,6 +543,7 @@ class framework_processor {
} catch (moodle_exception $e) {
// There was a major problem with this competency in this module.
$competencieswithissues[$competencyid] = true;
$message = get_string('errorwhilemigratingmodulecompetencywithexception', 'tool_lpmigrate',
$e->getMessage());
$this->log_error($courseid, $competencyid, $cmid, $message);
@@ -564,6 +565,7 @@ class framework_processor {
$this->modulecompetencyremovals++;
}
} catch (moodle_exception $e) {
$competencieswithissues[$competencyid] = true;
$this->log_warning($courseid, $competencyid, $cmid,
get_string('warningcouldnotremovemodulecompetency', 'tool_lpmigrate'));
}