diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-11 17:41:09 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-11 17:49:37 +0100 |
commit | 56667f16f7861d890896f6efc25a6c4fa157bf9e (patch) | |
tree | 894dd72406ab07d9951911beeed0afbf7815239e | |
parent | bbfa49753a730cc57831f7de548f5e3625d8a7e4 (diff) | |
download | sonarqube-56667f16f7861d890896f6efc25a6c4fa157bf9e.tar.gz sonarqube-56667f16f7861d890896f6efc25a6c4fa157bf9e.zip |
SONAR-6131 Measure drilldown is failing on removed components
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb index 442f7ab237c..620279a51f8 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb @@ -258,7 +258,7 @@ class ApplicationController < ActionController::Base def init_resource_for_role(role, resource_param=:id) @resource=Project.by_key(params[resource_param]) - unless @resource + unless @resource && @resource.enabled flash[:error] = message('dashboard.project_not_found') redirect_to :controller => :dashboard, :action => :index else diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb index 760e569a86d..c3fabf78a0d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb @@ -19,12 +19,13 @@ # class ComponentsController < ApplicationController + before_filter :init_resource_for_user_role + helper :metrics, :components SECTION = Navigation::SECTION_RESOURCE def index - init_resource_for_user_role @components_configuration = Sonar::ComponentsConfiguration.new @snapshots = Snapshot.all(:include => 'project', :conditions => ['snapshots.parent_snapshot_id=?', @snapshot.id]) |