Merge branch 'MDL-45258-master' of git://github.com/ankitagarwal/moodle

This commit is contained in:
Marina Glancy 2014-05-01 11:47:27 +08:00
commit 8505550532
2 changed files with 4 additions and 1 deletions

View File

@ -1215,6 +1215,9 @@ abstract class restore_dbops {
$usertag = (object)$usertag;
$tags[] = $usertag->rawname;
}
if (empty($newuserctxid)) {
$newuserctxid = null; // Tag apis expect a null contextid not 0.
}
tag_set('user', $newuserid, $tags, 'core', $newuserctxid);
}

View File

@ -136,7 +136,7 @@ if ($tagnew = $tagform->get_data()) {
}
//updated related tags
tag_set('tag', $tagnew->id, explode(',', trim($tagnew->relatedtags)), 'core', $systemcontext);
tag_set('tag', $tagnew->id, explode(',', trim($tagnew->relatedtags)), 'core', $systemcontext->id);
//print_object($tagnew); die();
redirect($CFG->wwwroot.'/tag/index.php?tag='.rawurlencode($tag->name)); // must use $tag here, as the name isn't in the edit form