-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
4.1.6, 4.2.3, 4.3
-
None
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
-
Steps to reproduce:
- Create a user profile field of type 'checkbox' and name Test field.
- In a course create an activity, with restriction related to that profile field. E.g. that Test field is equal to 1 (or not, or 0 instead of 1).
Expected result: it works.
Actual result: it does not.
The problem is around here: https://github.com/moodle/moodle/blob/master/availability/condition/profile/classes/condition.php#L297
It is using ===. However, while the value of the profile field for the user is a string (See cast above the switch) the test value in the JSON for this rule is an int, so this is always false.