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

Double submission prevention does not work reliable

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE

      The JavaScript code to prevent double submission of forms (lib/form/amd/src/submit.js) seems not to work reliable under Safari. The feature was introduced with MDL-38555. I noticed the bug while working on MDL-75083.

      With Safari it is (sometimes?!) possible to double submit Moodle forms. The submit button is not disabled as it should be after the first submit. This can be tested by creating a forum post for example.

      A little more testing and added debug output to the submit.js showed that the problem is caused by a race condition between the beforeunload event fired by the browser and setTimout(function, 0). Looks like Safari is a little slower than other browsers firing the beforeunload event. See the attached screenshots.

      Tested under macOS Big Sur (11.6) and Safari 15.0 (166612.1.29.51.4, 16612)

            Unassigned Unassigned
            jojoob Johannes Burk
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.