-
Task
-
Resolution: Fixed
-
Minor
-
3.10.1, 3.11, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE
-
MDL-70926-master -
- 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
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 MDL-70966
This issue has been re-purposed for another problem discovered in the process:
getdate(null)
|
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
Summary:
- 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.
Hence:
- 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.
- will be (partly) resolved by
-
MDL-70966 PHP 8.0: Empty string does not cast to 0
-
- Closed
-