From b48df57d9243336d4b96e29c5587137eff3a3c67 Mon Sep 17 00:00:00 2001 From: David Cabo Date: Fri, 23 Sep 2011 02:50:41 +0200 Subject: Remove invalid collate argument for public body searches The existing bug wasn't catched by the tests, because it only fails when running in dev: otherwise all the classes are loaded before the search is done, and acts_as_xapian can find the provided 'request_collapse' argument, even if the PublicBody class doesn't define it, since all the init options end up together in acts_as_xapian. --- app/controllers/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 06d8f15f4..e719a8898 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -39,7 +39,7 @@ class RequestController < ApplicationController if !params[:query].nil? query = params[:query] + '*' query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND! - @xapian_requests = perform_search([PublicBody], query, 'relevant', 'request_collapse', 5) + @xapian_requests = perform_search([PublicBody], query, 'relevant', nil, 5) end medium_cache end -- cgit v1.2.3 From c71551992bf3bf6204f298777bc04cc355ef4613 Mon Sep 17 00:00:00 2001 From: David Cabo Date: Mon, 26 Sep 2011 21:36:11 +0200 Subject: Removed hardcoded number of days. Fixes #199 --- app/controllers/request_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index e719a8898..4b7884065 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -314,10 +314,11 @@ class RequestController < ApplicationController # XXX send_message needs the database id, so we send after saving, which isn't ideal if the request broke here. @outgoing_message.send_message flash[:notice] = _("

Your {{law_used_full}} request has been sent on its way!

-

We will email you when there is a response, or after 20 working days if the authority still hasn't +

We will email you when there is a response, or after {{late_number_of_days}} working days if the authority still hasn't replied by then.

If you write about this request (for example in a forum or a blog) please link to this page, and add an - annotation below telling people about your writing.

",:law_used_full=>@info_request.law_used_full) + annotation below telling people about your writing.

",:law_used_full=>@info_request.law_used_full, + :late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20)) redirect_to show_new_request_path(:url_title => @info_request.url_title) end -- cgit v1.2.3