From: Simon Brandhof Date: Fri, 3 Oct 2014 13:08:31 +0000 (+0200) Subject: Fix loading of settings tabs X-Git-Tag: 4.5.1-RC1~115 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3406907abc194c2a665539f49cea1a16f877e667;p=sonarqube.git Fix loading of settings tabs --- diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java index d63abe3b2b5..353331ade15 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java +++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java @@ -145,7 +145,7 @@ public class SearchServer implements Monitored { @Override public boolean isReady() { - return node.client().admin().cluster().prepareHealth() + return node != null && node.client().admin().cluster().prepareHealth() .setWaitForYellowStatus() .setTimeout(TimeValue.timeValueSeconds(3L)) .get() @@ -248,7 +248,7 @@ public class SearchServer implements Monitored { } @Override - public synchronized void stop() { + public void stop() { if (node != null && !node.isClosed()) { node.close(); } 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 9ced766bb35..7e07115ce41 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 @@ -324,10 +324,10 @@ class ApplicationController < ActionController::Base if params[:category].nil? # Select the 'general' category by default. If 'general' category is not found, then return the first one. - default_category = @categories.empty? ? nil : (@categories.find {|c| c && c.key == 'general'} || @categories[0]) + default_category = @categories.empty? ? nil : (@categories.find {|c| c && c.key.downcase == 'general'} || @categories[0]) @category = default_category else - @category = @categories.find {|c| c && c.key == params[:category]} + @category = @categories.find {|c| c && c.key.casecmp(params[:category])==0} not_found('category') if @category.nil? end @@ -341,7 +341,7 @@ class ApplicationController < ActionController::Base ((@subcategories_per_categories[@category].include? @category) ? @category : @subcategories_per_categories[@category][0]) @subcategory = default_subcategory else - @subcategory = @subcategories_per_categories[@category].find {|s| s && s.key == params[:subcategory]} + @subcategory = @subcategories_per_categories[@category].find {|s| s && s.key.casecmp(params[:subcategory])==0} not_found('subcategory') if @subcategory.nil? end