MDL-71051 profilefield_datetime: Fix to missing required param.

The define_after_data method was looking for a required_param
when it should have been an optional parameter. This was causing
error messages when creating a new datetime field.
This commit is contained in:
Adrian Greeve 2021-04-30 13:00:21 +08:00
parent f104a01ba5
commit ffe3fa8ea8

View file

@ -104,7 +104,7 @@ class profile_define_datetime extends profile_define_base {
// by setDefault to the correct dates in the used calendar system. We only want
// to execute the rest of the code when we have the years in the DB saved in
// Gregorian that need converting to the date for this user.
$id = required_param('id', PARAM_INT);
$id = optional_param('id', 0, PARAM_INT);
if ($id === 0) {
return;
}