-
Bug
-
Resolution: Fixed
-
Major
-
2.5.2, 2.6.1, 2.8.6, 3.0.1
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE
-
MOODLE_30_STABLE, MOODLE_31_STABLE
-
MDL-43887-master -
-
3.2 Sprint 1
Noticed on Moodle 2.5.2+ that when you create custom field with date range where year minimum value is greater then unixtime start year (1970) and you make it optional it is enabled all the time, even if you on edit user profile page uncheck enable checkbox and press update profile.
This happens as date is bounded in /user/profile/field/datetime/field.class.php
with range start and end date (function edit_save_data_preprocess). So the date becomes not 0 anymore.
To reproduce problem:
- In user profile create a new custom field - date/time
- Use the values...
- Is this field required? No
- Start year 1971
- Go to a user's profile editing page.
- Check that your created custom field is disabled.
- Click update profile.
- Check the date field on the user's profile page
- Edit the user's profile again and check the date field
Expected result: The date is not set and remains disabled.
Actual result: The date is set to 1 Jan 1971 and is enabled. There is no way to disable the date.
- has been marked as being related by
-
MDL-54750 Properly handle unset dates with datetime field
- Closed