Double-form-submission bug in UM (manifesting with UM-Story extension)
-
We found that when using an extension such as ‘UM Story for Ultimate Member’, submitted stories were occasionally double-submitted.
We tracked the problem down to the code in the UM file ‘um-scripts.js’ (Um version 2.0.56) which disables the submit button after clicking once.
This code submited the form after a click on the submit button, but did not prevent the normal handling of the click, which in this case submitted the form again.
To prevent this we have added a ‘return false;’ to the UM click-handler.This should probably be ported back into the main UM plugin code.
Can someone submit this to the code developers?The specific changes we made were in the file ‘assets/js/um-scripts.js’, where we changed lines 368-371
jQuery(document).one('click', '.um:not(.um-account) .um-form input[class="um-button"][type="submit"]:not(.um-has-recaptcha)', function() { jQuery(this).attr('disabled','disabled'); jQuery(this).parents('form').submit(); });
to
jQuery(document).one('click', '.um:not(.um-account) .um-form input[class="um-button"][type="submit"]:not(.um-has-recaptcha)', function() { jQuery(this).attr('disabled','disabled'); jQuery(this).parents('form').submit(); return false; });
We have manually made corresponding changes to um-scripts.min.js.
- The topic ‘Double-form-submission bug in UM (manifesting with UM-Story extension)’ is closed to new replies.