From 68e6d171b1979d9a73a667f1e081d628390375a4 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 15 Mar 2013 15:15:10 +0100 Subject: [PATCH] Manually apply basic before_filters in case of routing error #1248 --- app/controllers/application_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abdc46a8..05207eb6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -54,7 +54,14 @@ class ApplicationController < ActionController::Base # FIXME: This doesn't work with Rails >= 3.0 anymore # Possible workaround: https://github.com/rails/rails/issues/671#issuecomment-1780159 - rescue_from ActionController::RoutingError, :with => proc{render_404} + rescue_from ActionController::RoutingError, :with => proc{ + # manually apply basic before_filters which aren't applied by default here + user_setup + check_if_login_required + set_localization + + render_404 + } include Redmine::Search::Controller include Redmine::MenuManager::MenuController