Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Fix Version/s: STABLE backlog
-
Component/s: Forms Library
-
Labels:
-
Difficulty:Easy
-
Affected Branches:MOODLE_20_STABLE
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?