Skip to content

Commit

Permalink
MDL-53716 competency: Do not restore competencies when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Apr 28, 2016
1 parent e9114a9 commit 56e1d9b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3186,6 +3186,11 @@ public function process_user_competency_course($data) {
*/
protected function execute_condition() {

// Do not restore when competencies are disabled.
if (!\core_competency\api::is_enabled()) {
return false;
}

// Do not execute if the competencies XML file is not found.
$fullpath = $this->task->get_taskbasepath();
$fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
Expand Down Expand Up @@ -3256,6 +3261,11 @@ public function process_course_module_competency($data) {
*/
protected function execute_condition() {

// Do not restore when competencies are disabled.
if (!\core_competency\api::is_enabled()) {
return false;
}

// Do not execute if the competencies XML file is not found.
$fullpath = $this->task->get_taskbasepath();
$fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
Expand Down

0 comments on commit 56e1d9b

Please sign in to comment.