mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-53716 competency: Do not restore competencies when disabled
This commit is contained in:
parent
e9114a9ed4
commit
56e1d9bada
1 changed files with 10 additions and 0 deletions
|
@ -3186,6 +3186,11 @@ class restore_course_competencies_structure_step extends restore_structure_step
|
|||
*/
|
||||
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;
|
||||
|
@ -3256,6 +3261,11 @@ class restore_activity_competencies_structure_step extends restore_structure_ste
|
|||
*/
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue