プロジェクト

全般

プロフィール

Vote #79797

未完了

Internal server error when click middle mouse button link add watcher

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

ステータス:
Confirmed
優先度:
通常
担当者:
-
カテゴリ:
Issues list_58
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
58
version_id:
33
issue_org_id:
30489
author_id:
378821
assigned_to_id:
0
comments:
7
status_id:
9
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Confirmed]

説明

Clicking middle mouse button on the add wathcer link in the context menu fails

ActionController::UnknownFormat in WatchersController#new
WatchersController#new is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: []

journals

--------------------------------------------------------------------------------
Maybe it is enough to return 404 when the request format is HTML?

<pre><code class="diff">
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index 3f080e9..cec2519 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -30,7 +30,10 @@ class WatchersController < ApplicationController
accept_api_auth :create, :destroy

def new
- @users = users_for_new_watcher
+ respond_to do |format|
+ format.html { render_404 }
+ format.js { @users = users_for_new_watcher }
+ end
end

def create
</code></pre>
--------------------------------------------------------------------------------
All tests pass with the above patch applied:
Test results: https://gitlab.com/marius-balteanu/redmine/-/jobs/155499251
Patch: https://gitlab.com/marius-balteanu/redmine/commit/bcf9de280551a69d5b449a5d569560cb191926aa.diff
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Since I use MacBook Pro and don't have a mouse with a middle button, I cannot reproduce the problem. Adding issue watchers works fine for me.

Could someone tell me how the middle button works and causes the error?
--------------------------------------------------------------------------------
Yes, middle button means Open link in new tab. To reproduce, go to an issue, right click on the Add watchers link and then Open link in a new tab. Technically, instead of an Ajax request you will do a simple get request.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Yes, middle button means Open link in new tab.

Thanks, I understand. I think this issue is not a big problem, so the fix that simply returns 404 is enough.

I found that this issue also affects the following links.

* "Watch" link
* "Search for watchers to add" link on "New issue" page
--------------------------------------------------------------------------------

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

  • カテゴリIssues list_58 にセット
  • 対象バージョンCandidate for next minor release_33 にセット

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

いいね!0
いいね!0