Permalink
Browse files

Improved error messages for role_assign to be more helpful

  • Loading branch information...
1 parent 9d829c6 commit 82396e5b1f485a7f8e7355cd344bd11dac887511 moodler committed Sep 22, 2006
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/accesslib.php
View
@@ -1363,17 +1363,17 @@ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $time
}
if ($userid && !record_exists('user', 'id', $userid)) {
- debugging('User does not exist!');
+ debugging('User ID '.intval($userid).' does not exist!');
return false;
}
if ($groupid && !record_exists('groups', 'id', $groupid)) {
- debugging('Group does not exist!');
+ debugging('Group ID '.intval($groupid).' does not exist!');
return false;
}
if (!$context = get_context_instance_by_id($contextid)) {
- debugging('A valid context must be provided');
+ debugging('Context ID '.intval($contextid).' does not exist!');
return false;
}

0 comments on commit 82396e5

Please sign in to comment.