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

Using compare rule results in fatal error in getValidationScript function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 1.9.2, 2.4
    • Forms Library
    • None
    • MOODLE_19_STABLE, MOODLE_24_STABLE
    • Easy

      Easiest way to reproduce this bug is adding this code to any moodle form:

      $mform->addElement('text','name1','3',array('size'=>3));
      $mform->addElement('hidden', 'name2', '5');
      $mform->addRule(array('name1', 'name2'),'You can\'t delete blanks','compare','>=','client',true);//uncommenting this line results in error in getValidationScript

      If you uncomment the last line you receive in Moodle 2.4
      "Fatal error: Call to a member function getType() on a non-object in Z:\home\moodle\www\lib\formslib.php on line 1818"

            danmarsden Dan Marsden
            oa_sychev Oleg Sychev
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.