]> source.dussan.org Git - sonarqube.git/commitdiff
Fix loading of settings tabs
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 3 Oct 2014 13:08:31 +0000 (15:08 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 3 Oct 2014 13:14:24 +0000 (15:14 +0200)
server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb

index d63abe3b2b50fd92fa54a71ca1db7fabda42390d..353331ade15f7fdc7767a33edfa52fe882dc4ed3 100644 (file)
@@ -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();
     }
index 9ced766bb359417d66116756d02b3e1254fd1fc2..7e07115ce413f409c583cb2c48bb60824b1f5e56 100644 (file)
@@ -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