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

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.6, 2.1.3, 2.2, 2.3
    • Fix Version/s: 2.0.7, 2.1.4, 2.2.1
    • Component/s: Libraries
    • Labels:
      None
    • Testing Instructions:
      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',
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                timhunt Tim Hunt
                Integrator:
                Sam Hemelryk
                Tester:
                Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/12