mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
some more fix on grade outcome scaleid, should be working now
This commit is contained in:
parent
a51512c9bc
commit
b2af9c5895
1 changed files with 9 additions and 8 deletions
|
@ -1357,23 +1357,24 @@
|
||||||
|
|
||||||
if ($info['GRADE_OUTCOME']['#']['SCALEID']['0']['#']) {
|
if ($info['GRADE_OUTCOME']['#']['SCALEID']['0']['#']) {
|
||||||
$scale = backup_getid($restore->backup_unique_code,"scale",backup_todb($info['GRADE_OUTCOME']['#']['SCALEID']['0']['#']));
|
$scale = backup_getid($restore->backup_unique_code,"scale",backup_todb($info['GRADE_OUTCOME']['#']['SCALEID']['0']['#']));
|
||||||
$derec->scaleid = $scale->new_id;
|
$dbrec->scaleid = $scale->new_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$modifier = backup_getid($restore->backup_unique_code,"user", backup_todb($info['GRADE_OUTCOME']['#']['USERMODIFIED']['0']['#']));
|
$modifier = backup_getid($restore->backup_unique_code,"user", backup_todb($info['GRADE_OUTCOME']['#']['USERMODIFIED']['0']['#']));
|
||||||
$derec->usermodified = $modifier->new_id;
|
$dbrec->usermodified = $modifier->new_id;
|
||||||
|
|
||||||
// Structure is equal to db, insert record
|
// Structure is equal to db, insert record
|
||||||
// If the shortname doesn't exist
|
// If the shortname doesn't exist
|
||||||
|
|
||||||
|
|
||||||
if (!empty($dbrec->courseid)) {
|
if (empty($info['GRADE_OUTCOME']['#']['COURSEID']['0']['#'])) {
|
||||||
$course_to_search = 0;
|
$prerec = get_record_sql("SELECT * FROM {$CFG->prefix}grade_outcomes
|
||||||
|
WHERE courseid IS NULL
|
||||||
|
AND shortname = '$dbrec->shortname'");
|
||||||
} else {
|
} else {
|
||||||
$course_to_search = $restore->course_id;
|
$prerec = get_record('grade_outcomes','courseid',$restore->course_id,'shortname',$dbrec->shortname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$prerec = get_record('grade_outcomes','courseid',$course_to_search,'shortname',$dbrec->shortname)) {
|
if (!$prerec) {
|
||||||
$newid = insert_record('grade_outcomes',$dbrec);
|
$newid = insert_record('grade_outcomes',$dbrec);
|
||||||
} else {
|
} else {
|
||||||
$newid = $prerec->id;
|
$newid = $prerec->id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue