Merge branch 'MDL-35198' of git://github.com/mouneyrac/moodle

This commit is contained in:
Sam Hemelryk 2012-10-16 11:23:24 +08:00
commit 8422094d91
8 changed files with 14 additions and 14 deletions

View file

@ -617,7 +617,7 @@ class core_role_external extends external_api {
// throw an exception if user is not able to assign the role in this context
$roles = get_assignable_roles($context, ROLENAME_SHORT);
if (!key_exists($assignment['roleid'], $roles)) {
if (!array_key_exists($assignment['roleid'], $roles)) {
throw new invalid_parameter_exception('Can not assign roleid='.$assignment['roleid'].' in contextid='.$assignment['contextid']);
}
@ -680,7 +680,7 @@ class core_role_external extends external_api {
// throw an exception if user is not able to unassign the role in this context
$roles = get_assignable_roles($context, ROLENAME_SHORT);
if (!key_exists($unassignment['roleid'], $roles)) {
if (!array_key_exists($unassignment['roleid'], $roles)) {
throw new invalid_parameter_exception('Can not unassign roleid='.$unassignment['roleid'].' in contextid='.$unassignment['contextid']);
}