From a4cdbff86c5a180574aa6596c5b295d97803ad3f Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 29 Aug 2017 20:12:41 +0200 Subject: [PATCH] MDL-59713 forms: prevent php warning when 'optional' option is missing --- lib/form/datetimeselector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/form/datetimeselector.php b/lib/form/datetimeselector.php index fb2d0eb841d..7a6644ece6c 100644 --- a/lib/form/datetimeselector.php +++ b/lib/form/datetimeselector.php @@ -228,7 +228,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group { } break; case 'createElement': - if ($arg[2]['optional']) { + if (isset($arg[2]['optional']) && $arg[2]['optional']) { // When using the function addElement, rather than createElement, we still // enter this case, making this check necessary. if ($this->_usedcreateelement) { -- 2.43.0