Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27145

Undefined index: optional in lib/form/dateselector.php on line 169

    XMLWordPrintable

Details

    • 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?

      Attachments

        Activity

          People

            samhemelryk Sam Hemelryk
            daniss Daniele Cordella
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: