Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.2
-
MOODLE_20_STABLE
-
Easy
Description
developing a module
I wrote in a form:
$mform->addElement('date_selector', $fieldname, get_string($fieldname.'_label', 'collection'), array('startyear' => 1900));
At run time I got the following notice from xdebug:
Undefined index: optional in /Applications/MAMP/htdocs/moodle20/lib/form/dateselector.php on line 169
Actually, in moodle20/lib/form/dateselector.php on line 169 I found
if($arg[2]['optional']) {
and with my call, $arg[2] is:
Array
(
[startyear] => 1900
)
only. Is this a bug?