-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.3.4, 3.4.1, 3.5
-
None
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
As introduced by when a custom field is required the user is redirected to the edit profile page to fill it.MDL-46946
But as detailed below when you update an existing custom profile field and set it as "required" the redirection does not work.
Steps to reproduce
- Go to Site administration/ Users / Accounts / User profile fields
- Create a custom profile field which is NOT required.
- Edit your profile without filling the new field.
- Edit the field and set "Is this field required?" to "Yes".
Expected : As the field is now required the user should be redirected to the edit profile page.
Actual : User is not redirected.
Explanation
- During profile edition/creation if a field is not required and not filled a record with an empty "data" column is created in user_info_field
- But profile_has_required_custom_fields_set() consider that a custom field is set if a record exists in user_info_field user/profile/lib.php#L850.
And as an empty record exists the user is not correctly redirected.
- duplicates
-
MDL-57929 profile_has_required_custom_fields_set fails to detect if a custom profile field is empty
- Closed