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

Form change checker does not warn after adding a repeated element

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.4, 3.10.1
    • None
    • Forms Library
    • 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

              Unassigned Unassigned
              dobedobedoh Andrew Lyons
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: