Defect #10675
closed"Submit and continue" is broken
Added by Etienne Massip over 12 years ago. Updated over 12 years ago.
0%
Description
"Submit and continue" button behaves just as "Submit" at issue creation.
Related issues
Updated by Etienne Massip over 12 years ago
- Affected version (unused) set to 1.4.0
- Affected version set to 1.4.0
Updated by Etienne Massip over 12 years ago
Reproduced with FF & Chrome, works fine on www.redmine.org but not on http://xxx.m.redmine.org.
According to my log, worked fine on r9381.
Since then, looks like submit control name is no more in POST
form data.
Updated by Etienne Massip over 12 years ago
Updated by Etienne Massip over 12 years ago
Following replacement might be overkill but works on Chrome & IE8:
function addFormObserversForDoubleSubmit() {
$$('form[method=post]').each(function(form) {
form.on('submit', function(form_submission) {
alreadySubmitted = (form.getStorage().get('submitting') == true);
if(alreadySubmitted)
form_submission.stop();
else
form.getStorage().set('submitting', true);
});
});
}
Updated by Etienne Massip over 12 years ago
Shorter, not tested:
function addFormObserversForDoubleSubmit() {
$$('form[method=post]').each(function(form) {
form.on('submit', function(form_submission) {
if(form.getStorage().get('submitted'))
form_submission.stop();
else
form.getStorage().set('submitted', true);
});
});
}
Updated by Jean-Philippe Lang over 12 years ago
- Target version changed from Candidate for next minor release to 1.4.1
Updated by Etienne Massip over 12 years ago
Note: of course the above code will break any form in the application which should be allowed to be submitted more than once.
Updated by Jean-Philippe Lang over 12 years ago
The shorter patch works fine for with FF11, latest Chrome and IE6/9 as well. Please commit.
Etienne Massip wrote:
Note: of course the above code will break any form in the application which should be allowed to be submitted more than once.
So did r9391. We can add a special class on forms that need to be submitted more than once.
Updated by Etienne Massip over 12 years ago
Jean-Philippe Lang wrote:
So did r9391. We can add a special class on forms that need to be submitted more than once.
Are there such forms? I was thinking of some Rails dark magic reloading only a part of the form DOM via XHR on form submission, but I don't know if it exists?
Updated by Jean-Philippe Lang over 12 years ago
I don't think there is any of these forms in the core but it might be desirable, just in case a plugin needs it. Something like:
function addFormObserversForDoubleSubmit() {
$$('form[method=post]').each(function(form) {
if (!form.hasClassName('multiple-submit')) {
form.on('submit', function(form_submission) {
if(form.getStorage().get('submitted'))
form_submission.stop();
else
form.getStorage().set('submitted', true);
});
}
});
}
Updated by Jean-Philippe Lang over 12 years ago
- Status changed from Confirmed to Closed
- Resolution set to Fixed
Fix committed, thanks.