]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3671 Delete log "undefined method `column_layout' for nil:NilClass"
authorDavid Gageot <david@gageot.net>
Wed, 18 Jul 2012 10:25:26 +0000 (12:25 +0200)
committerDavid Gageot <david@gageot.net>
Wed, 18 Jul 2012 10:25:36 +0000 (12:25 +0200)
Raise a proper NotFound http error instead

plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb

index 806c76bc31f623d3767303896cdb23f17f38967d..2fdd37c351c2feee1ceb476c21049f31bed6b4e5 100644 (file)
@@ -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
index eedcb926c5d522e3b09bd94ea6b56fe30c9fc973..5c02d7a47e13c5788119f7ef2ab2b932801b4b5e 100644 (file)
@@ -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