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

M.util.show_confirm_dialog should include value of the button clicked, and should work on form submits

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.6, 2.1.3, 2.2, 2.3
    • 2.0.7, 2.1.4, 2.2.1
    • Libraries
    • None
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      The MDL-27314 testing instructions can be used to test this.

      To test the onsubmit bit, change line 735 of attemptsreport.php from

      $PAGE->requires->event_handler('#deleteattemptsbutton', 'click', 'M.util.show_confirm_dialog',

      to

      $PAGE->requires->event_handler('#attemptsform', 'submit', 'M.util.show_confirm_dialog',

      Show
      The MDL-27314 testing instructions can be used to test this. To test the onsubmit bit, change line 735 of attemptsreport.php from $PAGE->requires->event_handler('#deleteattemptsbutton', 'click', 'M.util.show_confirm_dialog', to $PAGE->requires->event_handler('#attemptsform', 'submit', 'M.util.show_confirm_dialog',

    Description

      This was found while working on MDL-27314.

      Normally, when you click a submit button in a form, the name and value of the submit button that were clicked are submitted as a post variable. M.util.show_confirm_dialog is not sending that information, which sometimes is critical.

      Also, it is not possible to use M.util.show_confirm_dialog as a form event handler.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Sam Hemelryk Sam Hemelryk
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jan/12