Skip to content

Commit

Permalink
MDL-15020 fixed typo causing deleting of all roles and contexts - tha…
Browse files Browse the repository at this point in the history
…nks Joseph!
  • Loading branch information
skodak committed May 27, 2008
1 parent 5412cd2 commit 568df47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2090,9 +2090,9 @@ function delete_context($contextlevel, $instanceid) {
// do not use get_context_instance(), because the related object might not exist,
// or the context does not exist yet and it would be created now
if ($context = $DB->get_record('context', array('contextlevel'=>$contextlevel, 'instanceid'=>$instanceid))) {
$result = delete_records('role_assignments', array('contextid'=>$context->id)) &&
delete_records('role_capabilities', array('contextid'=>$context->id)) &&
delete_records('context', array('id'=>$context->id));
$result = $DB->delete_records('role_assignments', array('contextid'=>$context->id)) &&
$DB->delete_records('role_capabilities', array('contextid'=>$context->id)) &&
$DB->delete_records('context', array('id'=>$context->id));

// do not mark dirty contexts if parents unknown
if (!is_null($context->path) and $context->depth > 0) {
Expand Down

0 comments on commit 568df47

Please sign in to comment.