Project

General

Profile

Actions

Defect #21579

closed

The cancel operation in the issue edit mode doesn't work

Added by Nils Grimm about 8 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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


Related issues

Has duplicate Redmine - Defect #24756: Clicking Cancel in Issue edit page nothing happens.Closed

Actions
Actions #1

Updated by Sven Culley about 8 years ago

Could you provide more details regarding this issue?
I am using Google Chrome and everything works fine.

Actions #2

Updated by Go MAEDA about 8 years ago

  • Status changed from New to Needs feedback
Actions #3

Updated by Nils Grimm about 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.

Actions #4

Updated by Go MAEDA about 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.

Actions #5

Updated by Sonia Zh over 7 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.
In another word, here are the steps to reproduce the 'bug':
Lets consider your issue id: #123

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 %>

Actions #6

Updated by Toshi MARUYAMA over 7 years ago

  • Status changed from Closed to Confirmed
  • Resolution deleted (Invalid)

sonia zh wrote:

I can confirm from bulk edit.

Actions #7

Updated by Go MAEDA about 7 years ago

  • Has duplicate Defect #24756: Clicking Cancel in Issue edit page nothing happens. added
Actions #8

Updated by Go MAEDA about 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.
Actions #9

Updated by Charlene Chen about 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 %>
Actions #10

Updated by Marius BĂLTEANU about 7 years ago

Here is a patch with tests that fixes this issue.

Actions #11

Updated by Go MAEDA about 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.

Actions #12

Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from Confirmed to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Patch committed, thanks.

Actions

Also available in: Atom PDF