プロジェクト

全般

プロフィール

Vote #75412

完了

Attempting to Add a Related Issue Multiple Times Sequentially Causes 500

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
99
issue_org_id:
17517
author_id:
104336
assigned_to_id:
0
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
82
ステータス-->[Closed]

説明

When pressing "Add" after typing a related issue, the form ajax submits but does not prevent further ajax submits while the request is being processed.

As a result of this, clicking "add" multiple times quickly will cause sequential requests to link an issue (after the first) to fail; along with this, the results of the last post are displayed (meaning the first successful add of a related issue may be hidden).

proposed patch:

diff --git a/app/views/issue_relations/_form.html.erb b/app/views/issue_relations/_form.html.erb
index 29b7f0f..ff80e47 100644
--- a/app/views/issue_relations/_form.html.erb
+++ b/app/views/issue_relations/_form.html.erb
@@ -5,7 +5,7 @@
 
-<%= submit_tag l(:button_add) %>
+<%= submit_tag l(:button_add), :disable_with => l(:button_add) %>
 <%= link_to_function l(:button_cancel), '$("#new-relation-form").hide();'%>
 


journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
https://github.com/plataformatec/devise/issues/2343#issuecomment-15334387

> DEPRECATION WARNING: :disable_with option is deprecated and will be removed from Rails 4.1. Use 'data: { disable_with: 'Text' }' instead.
--------------------------------------------------------------------------------
The proposed fix has a side effect with Firefox (tested with 24 ESR):
# go to an issue, add a relation
# hit F5
# click on the 'Add' link to add another relation => the 'Add' button is disabled

Problem doesn't occur if step 2 is omitted.

BTW, I don't get 500 errors when hitting the button multiple times. I only get a proper validation error message. Can you post your 500 error stack trace ?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
It seems that the @data-disable-with@ attribute is enabled by default in Rails 5. There are some examples "here":http://api.rubyonrails.org/v5.1.3/classes/ActionView/Helpers/FormTagHelper.html#method-i-submit_tag.

Also, I tested this issue on the current trunk and works as expected in the major browsers (Safari, Chrome and Firefox) on OS X. I propose to mark this ticket as fixed by #23630.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Considering that the issue seems to be fixed in version version:4.0.0 by the migration to Rails 5.1, I would like a second opinion before closing it.
--------------------------------------------------------------------------------
Works for me
--------------------------------------------------------------------------------


related_issues

relates,Closed,23630,Migrate to Rails 5.2

Admin Redmine さんが3年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン4.0.0_99 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0