Only build filter if named params are set

This commit is contained in:
Kyle Johnson 2015-01-05 14:21:19 -05:00
parent 648252cf50
commit afefef3cc2
1 changed files with 6 additions and 2 deletions

View File

@ -22,9 +22,13 @@ class EventsController extends AppController {
*/
public function index() {
$this->Event->recursive = -1;
$this->FilterComponent = $this->Components->load('Filter');
$conditions = $this->FilterComponent->buildFilter($this->request->params['named']);
if ($this->request->params['named']) {
$this->FilterComponent = $this->Components->load('Filter');
$conditions = $this->FilterComponent->buildFilter($this->request->params['named']);
} else {
$conditions = array();
}
// How many events to return
$this->loadModel('Config');