Commit 29e0bca4 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Make sure there's no nil result in auto_complete.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4503 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a8b12bcb
......@@ -11,6 +11,7 @@ class AutoCompletesController < ApplicationController
unless q.blank?
@issues += query.visible.find(:all, :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%"], :limit => 10)
end
@issues.compact!
render :layout => false
end
......
......@@ -29,6 +29,6 @@ class AutoCompletesControllerTest < ActionController::TestCase
Setting.cross_project_issue_relations = '0'
get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
assert_response :success
assert_equal [nil], assigns(:issues)
assert_equal [], assigns(:issues)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment