Fixed bug when doing a search with an empty query.

This commit is contained in:
Loic d'Anterroches 2008-08-13 20:47:06 +02:00
parent 2e36487be4
commit 2a1628f8de

View File

@ -186,11 +186,12 @@ class IDF_Views_Issue
public $search_precond = array('IDF_Precondition::accessIssues'); public $search_precond = array('IDF_Precondition::accessIssues');
public function search($request, $match) public function search($request, $match)
{ {
$prj = $request->project;
if (!isset($request->REQUEST['q']) or trim($request->REQUEST['q']) == '') { if (!isset($request->REQUEST['q']) or trim($request->REQUEST['q']) == '') {
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index'); $url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index',
array($prj->shortname));
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);
} }
$prj = $request->project;
$q = $request->REQUEST['q']; $q = $request->REQUEST['q'];
$title = sprintf(__('Search Issues - %s'), Pluf_esc($q)); $title = sprintf(__('Search Issues - %s'), Pluf_esc($q));
$issues = new Pluf_Search_ResultSet(IDF_Search::mySearch($q, $prj)); $issues = new Pluf_Search_ResultSet(IDF_Search::mySearch($q, $prj));