From ffe3fa8ea8cfae5dee060bc7c25e49331e00f2e0 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Fri, 30 Apr 2021 13:00:21 +0800 Subject: [PATCH] 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. --- user/profile/field/datetime/define.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/profile/field/datetime/define.class.php b/user/profile/field/datetime/define.class.php index f574bdf473a..cf6f3945181 100644 --- a/user/profile/field/datetime/define.class.php +++ b/user/profile/field/datetime/define.class.php @@ -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; }