Defect #21579
closedThe cancel operation in the issue edit mode doesn't work
Added by Nils Grimm over 8 years ago. Updated over 7 years ago.
0%
Description
Since the upgrade to the 3.2.0 the cancel operation in the edit mode of an issue is simply doing nothing.
You can click on it but the GUI doesn't react.
Files
rm_21579_fix_cancel_edit_link_for_issues.patch (1.81 KB) rm_21579_fix_cancel_edit_link_for_issues.patch | Marius BĂLTEANU, 2017-02-19 14:24 |
Related issues
Updated by Sven Culley over 8 years ago
Could you provide more details regarding this issue?
I am using Google Chrome and everything works fine.
Updated by Nils Grimm over 8 years ago
I tested it again after Christmas and can't reproduce it any more.
I'm sorry, please close the ticket.
Thank and a happy new year.
Updated by Go MAEDA over 8 years ago
- Status changed from Needs feedback to Closed
- Priority changed from High to Normal
- Resolution set to Invalid
Thanks for your feedback. Closing.
Have a great new year.
Updated by Sonia Zh about 8 years ago
Hello,
I have the cancel operation in the edit mode of an issue as well but I don't know if this is the same bug you had.It does not happen all the time:
- if you are displaying the edit form through the edit or update method in the issues_controller, your cancel button won't work.
- if the edit form came from a render through another view or action such as show method in the issues_controller, then your cancel button will work.
Lets consider your issue id: #123
- go to: http://yourRedmine.com/issues/123/edit
- the cancel operation won't do anything
I have corrected it but I don't know it this is a good practice... If you have another way, please share it ^^
I replace in app/views/issues/_edit.html.erb:
<%= f.hidden_field :lock_version %>
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= submit_tag l(:button_submit) %>
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' %>
| <%= link_to l(:button_cancel), {}, :onclick => "$('#update').hide(); return false;" %>
BY:
<%= f.hidden_field :lock_version %>
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= submit_tag l(:button_submit) %>
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' %>
|
<% if params[:action] == "show" %>
<%= link_to l(:button_cancel), {}, :onclick => "$('#update').hide(); return false;" %>
<% else %>
<%= link_to l(:button_cancel), issue_path(id: @issue.id) %>
<% end %>
Updated by Toshi MARUYAMA almost 8 years ago
- Status changed from Closed to Confirmed
- Resolution deleted (
Invalid)
Updated by Go MAEDA over 7 years ago
- Has duplicate Defect #24756: Clicking Cancel in Issue edit page nothing happens. added
Updated by Go MAEDA over 7 years ago
Steps to reproduce from #24756:
From the issue list,
- Select one issue row,
- Right click and Edit
- In the edit page of a single issue, Click Cancel. Nothing happens.
Updated by Charlene Chen over 7 years ago
It is easy to fix this.
What I did was adding a new js function to replace the one used in /issues/_edit.html.erb
<%= link_to l(:button_cancel), {}, :onclick => "buttonCancel(event); return false;" %>
<%= javascript_tag do %>
function buttonCancel(event) {
if($('#update').length){
$('#update').hide();
} else {
var url = $(location).attr('href');
var redirect = url.substr(url.lastIndexOf('/')+1) == 'edit' ? url.substr(0, url.lastIndexOf('/')) : url;
$(location).attr('href', redirect);
}
}
<% end %>
Updated by Marius BĂLTEANU over 7 years ago
- File rm_21579_fix_cancel_edit_link_for_issues.patch rm_21579_fix_cancel_edit_link_for_issues.patch added
Here is a patch with tests that fixes this issue.
Updated by Go MAEDA over 7 years ago
- Target version set to 3.4.0
The patch submitted by Marius BALTEANU works fine for me. Thanks for fixing the problem.
Setting target version to 3.4.0.
Updated by Jean-Philippe Lang over 7 years ago
- Status changed from Confirmed to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
Patch committed, thanks.