Project

General

Profile

Actions

Defect #30489

closed

Internal server error when click middle mouse button link add watcher

Added by Alex Tim over 5 years ago. Updated 5 months ago.

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

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

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: []

Related issues

Is duplicate of Redmine - Patch #39894: Explicitly render a 404 on non-JS requests to watchers#newClosedMarius BĂLTEANU

Actions
Actions #1

Updated by Marius BĂLTEANU over 5 years ago

  • Status changed from New to Confirmed
Actions #2

Updated by Marius BĂLTEANU over 5 years ago

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

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
Actions #4

Updated by Marius BĂLTEANU over 5 years ago

  • Target version set to Candidate for next minor release
Actions #5

Updated by Go MAEDA over 5 years ago

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?

Actions #6

Updated by Marius BĂLTEANU over 5 years ago

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.

Actions #7

Updated by Go MAEDA over 5 years ago

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
Actions #8

Updated by Marius BĂLTEANU 5 months ago

  • Is duplicate of Patch #39894: Explicitly render a 404 on non-JS requests to watchers#new added
Actions #9

Updated by Marius BĂLTEANU 5 months ago

  • Status changed from Confirmed to Closed
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Duplicate

Fixed in #39894, closing this as Duplicate.

Actions #10

Updated by Go MAEDA 5 months ago

  • Target version deleted (Candidate for next minor release)
Actions

Also available in: Atom PDF