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

Form change checker does not warn after adding a repeated element

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.4, 3.10.1
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE

      Description

      Given I am creating a new multipe choice quesetion
      And I set the "Question name" to "Example"
      When I press "Blanks for 3 more choices"
      And I follow "Site home"
      Then I should see the form change checker
      However I am navigated away from the page

      We need to extend the check in lib/formslib.php::startForm() to add $this->isSubmitted(), i.e.

      if ($this->is_dirty() }} $this->isSubmitted()) {
          $PAGE->requires->js_call_amd('core_form/changechecker', 'markFormAsDirtyById', [$formid]);
      }
      

      This will ensure that a form which was submitted, but rejected, is marked as dirty.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              dobedobedoh Andrew Nicols
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: