From 10cb2941e590f5e2d114c49938ae148b3e8def91 Mon Sep 17 00:00:00 2001 From: Michael Aherne Date: Wed, 17 May 2023 15:25:49 +0100 Subject: [PATCH] MDL-78235 userprofile: Check for defaultdata with isset(). --- user/profile/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/profile/lib.php b/user/profile/lib.php index b6a2cc21812..86058b71c77 100644 --- a/user/profile/lib.php +++ b/user/profile/lib.php @@ -258,7 +258,7 @@ class profile_field_base { * @param MoodleQuickForm $mform instance of the moodleform class */ public function edit_field_set_default($mform) { - if (!empty($this->field->defaultdata)) { + if (isset($this->field->defaultdata)) { $mform->setDefault($this->inputname, $this->field->defaultdata); } }