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

Using compare rule results in fatal error in getValidationScript function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.2, 2.4
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_24_STABLE

      Description

      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"

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: