From 5f7425874f8579f0a1046ef8000ffb1fefc5c2ed Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 15 May 2012 14:26:56 +0200 Subject: [PATCH] Fix filters and dashboards on Oracle and Derby Two SQL queries used a postgresql specific syntax. --- .../main/webapp/WEB-INF/app/controllers/filters_controller.rb | 2 +- .../main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb index c8764755843..79c1fb4c9c9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb @@ -28,7 +28,7 @@ class FiltersController < ApplicationController before_filter :login_required, :except => ['index', 'treemap'] def manage - @filters = ::Filter.find(:all, :conditions => ['user_id=? or shared is true', current_user.id]) + @filters = ::Filter.find(:all, :conditions => ['user_id=? or shared=?', current_user.id, true]) end def new diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb index cdca2e2d282..cbf7fd35d00 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb @@ -38,7 +38,7 @@ module WidgetPropertiesHelper elsif definition.type.name()==WidgetProperty::TYPE_FILTER user_filters = ::Filter.find(:all, :conditions => ['user_id=?', current_user.id]).sort_by(&:id).collect { |f| "" } - shared_filters = ::Filter.find(:all, :conditions => ['(user_id<>? or user_id is null) and shared is true', current_user.id]).sort_by(&:id).collect { |f| "" } + shared_filters = ::Filter.find(:all, :conditions => ['(user_id<>? or user_id is null) and shared=?', current_user.id, true]).sort_by(&:id).collect { |f| "" } all_filters = '' + user_filters.to_s + '' + '' + shared_filters.to_s + '' select_tag definition.key(), all_filters -- 2.39.5