Affects Version/s: 3.10.1, 3.11, 4.0
Fix Version/s: 3.11
Component/s: Forms Library
- Open a course
- Go into "Announcements" forum or create a new forum
- Select "Export" from the settings cog
- Make sure the fields "Posts from" and "Posts to" default to the current date
Affected Branches:MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
Pull from Repository:
Pull 3.11 Branch:
Pull 3.11 Diff URL:
Pull Master Branch:
Pull Master Diff URL:
The original description of this issue has been modified. Initially it was reported as an error in the dateselector field which is actually part of
This issue has been re-purposed for another problem discovered in the process:
returns different results in PHP8 and PHP7. Since Moodle supports both php7 and php8 we need to make sure that usergetdate() is never called with the null argument because the behavior will be inconsistent.
To see the differences, take a look to https://3v4l.org/PeZhr
- Not passing anything is consistent, returns now (2021).
- Passing zero (0) is consistent, returns 0 (1970)
- Passing null is inconsistent, with php7 it returns 0, but with php8, it returns now.
- We must prevent any (inconsistent) call passing null to happen (that's what the 1st commit does, detect).
- We must change any call previously passing null, to pass 0, to keep results the same. 2nd commit will do.