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

Formslib gets confused if a required field is frozen

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1, 1.9
    • Component/s: Forms Library
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Steps to reproduce:

      1. Apply the attached patch to 1.8+.

      2. Go to the editing questions screen of any course.

      3. Add a new true/false question.

      You will see a lot of debugging output on the screen. This comes from code the patch adds to the getValidationScript method which starts on line 993 of formslib.php.

      The point to note is that in the first array dumped to screen, element 8 is the 'Penalty factor' Field, while in the last array dumped to the screen, this has got corrupted and replaced by a copy of the 'Default question grade' field.

      I have no idea how that happened.

      If the issues is that actually I have frozen a required field, then we really need a removeRule method, to complement addRule.

        Attachments

          Activity

            People

            Assignee:
            jamiesensei Jamie Pratt
            Reporter:
            timhunt Tim Hunt
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Jun/07