Skip to content

Commit

Permalink
bugfix: passed 'rule_id' MUST be of type int
Browse files Browse the repository at this point in the history

otherwise a TypeError Exception is raised:

TypeError thrown with message "Argument 1 passed to ilLDAPRoleAssignmentRule::_getInstanceByRuleId() must be of the type int, string given, called in /.../Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php on line 103"

Stacktrace:
ILIAS-eLearning#14 TypeError in /.../Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php:62
ILIAS-eLearning#13 ilLDAPRoleAssignmentRule:_getInstanceByRuleId in /.../Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php:103
ILIAS-eLearning#12 ilLDAPRoleAssignmentRules:getAssignmentsForUpdate in /.../Services/LDAP/classes/class.ilLDAPAttributeToUser.php:140
  • Loading branch information
Uwe Tesche authored and dsstrassner committed Jan 31, 2023
1 parent 1db8ead commit d1f2bd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function getAssignmentsForUpdate(int $a_server_id, $a_usr_id, $a_u
$res = $ilDB->query($query);
$roles = [];
while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
$rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId($row->rule_id);
$rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId((int) $row->rule_id);

$matches = $rule->matches($a_usr_data);
if ($matches && $row->add_on_update) {
Expand Down

0 comments on commit d1f2bd8

Please sign in to comment.