Defect #21579

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

Added by Nils Grimm over 1 year ago. Updated 4 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:3.4.0
Resolution:Fixed Affected version:3.2.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.

rm_21579_fix_cancel_edit_link_for_issues.patch Magnifier (1.81 KB) Marius BALTEANU, 2017-02-19 14:24


Related issues

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

Associated revisions

Revision 16361
Added by Jean-Philippe Lang 4 months ago

The cancel operation in the issue edit mode doesn't work (#21579).

Patch by Marius BALTEANU.

History

#1 Updated by Sven Culley over 1 year ago

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

#2 Updated by Go MAEDA over 1 year ago

  • Status changed from New to Needs feedback

#3 Updated by Nils Grimm over 1 year 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.

#4 Updated by Go MAEDA over 1 year 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.

#5 Updated by Sonia Zh 11 months 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 %>

#6 Updated by Toshi MARUYAMA 10 months ago

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

sonia zh wrote:

I can confirm from bulk edit.

#7 Updated by Go MAEDA 6 months ago

  • Duplicated by Defect #24756: Clicking Cancel in Issue edit page nothing happens. added

#8 Updated by Go MAEDA 6 months 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.

#9 Updated by Charlene Chen 4 months 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 %>

#10 Updated by Marius BALTEANU 4 months ago

Here is a patch with tests that fixes this issue.

#11 Updated by Go MAEDA 4 months 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.

#12 Updated by Jean-Philippe Lang 4 months ago

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

Patch committed, thanks.

Also available in: Atom PDF