Project

General

Profile

Actions

Defect #8537

closed

Error in copying projects

Defect #8537: Error in copying projects

Added by Luis Serrano Aranda over 15 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Projects
Target version:
-
Resolution:
Fixed
Affected version:

Description

If the copy of a project takes (the project is long) and re-click the copy button, Redmine allows this action and copy two projects with exactly the same characteristics (id and name included).

It would be possible disable the copy button, until the copy is complete or there is a time out ?

Thanks


Related issues 2 (0 open — 2 closed)

Related to Redmine - Defect #6579: Tree hierachy being currupted on multiple submissions of an issueClosedJean-Philippe LangActions
Related to Redmine - Feature #23630: Migrate to Rails 5.2ClosedJean-Philippe LangActions

Updated by Luis Serrano Aranda over 15 years ago Actions #1

Addint a message like Loading... But typing Working...

Updated by Luis Serrano Aranda over 15 years ago Actions #2

A possible solution is to add this code at the end of prototype.js, disable the button until the task is completed.

var SubmitHelper = {
disableFormsOfPage: function(){
$$('form').each(function(form) {
form.observe('submit', function() {
form.getInputs('submit').each(function(submit) {
if (!submit.readAttribute("no_disabled")){
submit.disable();
}
});
});
});
},
init: function(){
Event.observe(window, 'load', SubmitHelper.disableFormsOfPage.bindAsEventListener())
}
}

SubmitHelper.init();

Updated by Luis Serrano Aranda over 15 years ago Actions #3

This a workaround, but not solve the concurrently, the backward...

I think it's better write a flag in the server (to not copy a project concurrently)

Updated by Masamitsu Murase over 15 years ago Actions #4

I think that this workaround does not work when an user select "Create and continue" button,
because "continue" parameter is not sent to the server if "Create and continue" is disabled.

Therefore,

  if (!submit.readAttribute("no_disabled")){
    submit.disable();
  }

should be
  if (!submit.readAttribute("no_disabled")){
    setTimeout(function(){ submit.disable(); }, 0);
  }

Please refer to my plugin.
(This plugin works on only "Issue" page currently...)

Regards,
Murase

Updated by Go MAEDA over 8 years ago Actions #5

Updated by Go MAEDA over 8 years ago Actions #6

  • Status changed from New to Closed
  • Resolution set to Fixed

It will be fixed in Redmine 4.0.0. Rails 5 automatically disables submit buttons while executing an action. See also: https://github.com/rails/rails/pull/21135

Actions

Also available in: PDF Atom