Defect #10675
"Submit and continue" is broken
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | Issues | |||
| Target version: | 1.4.1 | |||
| Affected version: | 1.4.0 | Resolution: | Fixed |
Description
"Submit and continue" button behaves just as "Submit" at issue creation.
Related issues
Associated revisions
History
#1 Updated by Etienne Massip about 1 year ago
- Affected version set to 1.4.0
#2 Updated by Etienne Massip about 1 year 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.
#3 Updated by Etienne Massip about 1 year ago
#4 Updated by Etienne Massip about 1 year 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);
});
});
}
#5 Updated by Etienne Massip about 1 year 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);
});
});
}
#6 Updated by Jean-Philippe Lang about 1 year ago
- Target version changed from Candidate for next minor release to 1.4.1
#7 Updated by Etienne Massip about 1 year ago
Note: of course the above code will break any form in the application which should be allowed to be submitted more than once.
#8 Updated by Jean-Philippe Lang about 1 year 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.
#9 Updated by Etienne Massip about 1 year 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?
#10 Updated by Jean-Philippe Lang about 1 year 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);
});
}
});
}
#11 Updated by Etienne Massip about 1 year ago
Think you've got the best answer.
#12 Updated by Jean-Philippe Lang about 1 year ago
- Status changed from Confirmed to Closed
- Resolution set to Fixed
Fix committed, thanks.