Vote #77040
完了The cancel operation in the issue edit mode doesn't work
0%
説明
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.
journals
Could you provide more details regarding this issue?
I am using Google Chrome and everything works fine.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Thanks for your feedback. Closing.
Have a great new year.
--------------------------------------------------------------------------------
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
* 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:
<pre><code class="ruby">
<%= 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;" %>
</code></pre>
BY:
<pre><code class="ruby">
<%= 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 %>
</code></pre>
--------------------------------------------------------------------------------
sonia zh wrote:
> * go to: http://yourRedmine.com/issues/123/edit
I can confirm from bulk edit.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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
<pre><code class="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 %>
</code></pre>
--------------------------------------------------------------------------------
Here is a patch with tests that fixes this issue.
--------------------------------------------------------------------------------
The patch submitted by Marius BALTEANU works fine for me. Thanks for fixing the problem.
Setting target version to 3.4.0.
--------------------------------------------------------------------------------
Patch committed, thanks.
--------------------------------------------------------------------------------
related_issues
duplicates,Closed,24756,Clicking Cancel in Issue edit page nothing happens.