mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-43697-master' of https://github.com/praxisdigital/moodle
This commit is contained in:
commit
c79778bf9f
@ -835,7 +835,9 @@ class backup_badges_structure_step extends backup_structure_step {
|
||||
}
|
||||
|
||||
protected function define_structure() {
|
||||
global $CFG;
|
||||
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
// Define each element separated.
|
||||
|
||||
$badges = new backup_nested_element('badges');
|
||||
@ -886,7 +888,15 @@ class backup_badges_structure_step extends backup_structure_step {
|
||||
|
||||
// Define sources.
|
||||
|
||||
$badge->set_source_table('badge', array('courseid' => backup::VAR_COURSEID));
|
||||
$parametersql = '
|
||||
SELECT *
|
||||
FROM {badge}
|
||||
WHERE courseid = :courseid
|
||||
AND status != ' . BADGE_STATUS_ARCHIVED;
|
||||
$parameterparams = [
|
||||
'courseid' => backup::VAR_COURSEID
|
||||
];
|
||||
$badge->set_source_sql($parametersql, $parameterparams);
|
||||
$criterion->set_source_table('badge_criteria', array('badgeid' => backup::VAR_PARENTID));
|
||||
$endorsement->set_source_table('badge_endorsement', array('badgeid' => backup::VAR_PARENTID));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user