Skip to content

Commit

Permalink
MDL-45258 tags:context object/0 should not be passed to tag_set()
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal committed Apr 28, 2014
1 parent 83ddacf commit a9282e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backup/util/dbops/restore_dbops.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,9 @@ public static function create_included_users($basepath, $restoreid, $userid,
$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);
}

Expand Down
2 changes: 1 addition & 1 deletion tag/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
}

//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
Expand Down

0 comments on commit a9282e4

Please sign in to comment.