From 5c1c1319a3e5c30b7f6d7caeaedb9c44ac08737e Mon Sep 17 00:00:00 2001 From: David Gageot Date: Wed, 18 Jul 2012 12:25:26 +0200 Subject: [PATCH] SONAR-3671 Delete log "undefined method `column_layout' for nil:NilClass" Raise a proper NotFound http error instead --- .../src/main/resources/org/sonar/l10n/core.properties | 1 + .../WEB-INF/app/controllers/dashboard_controller.rb | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 806c76bc31f..2fdd37c351c 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -545,6 +545,7 @@ dashboard.create_project_dashboard=Create project dashboard dashboard.create_global_dashboard=Create global dashboard dashboard.edit_dashboard=Edit dashboard dashboard.update_dashboard=Update dashboard +dashboard.not_found=This dashboard was not found dashboard.error_create_existing_name=A dashboard already exists with the same name dashboard.error_follow_existing_name=A dashboard already exists with the same name dashboard.default_restored=Default dashboards are restored diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index eedcb926c5d..5c02d7a47e1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -25,7 +25,6 @@ class DashboardController < ApplicationController before_filter :login_required, :except => [:index] def index - # TODO display error page if no dashboard or no resource load_resource() if !@resource || @resource.display_dashboard? @@ -40,14 +39,11 @@ class DashboardController < ApplicationController end def configure - # TODO display error page if no dashboard or no resource load_resource() load_dashboard() + @category=params[:category] load_widget_definitions(@category) - unless @dashboard - redirect_to home_path - end end def set_layout @@ -175,6 +171,8 @@ class DashboardController < ApplicationController @dashboard=(active ? active.dashboard : nil) end + not_found('dashboard') unless @dashboard + @dashboard_configuration=Api::DashboardConfiguration.new(@dashboard, :period_index => params[:period], :snapshot => @snapshot) if @dashboard && @snapshot end -- 2.39.5