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

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

    XMLWordPrintable

    Details

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

        Attachments

          Activity

            People

            • Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              daniss Daniele Cordella
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: