From afefef3cc2757a77dda9f4d8ee78ca5ef742c7de Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Mon, 5 Jan 2015 14:21:19 -0500 Subject: [PATCH] Only build filter if named params are set --- web/api/app/Controller/EventsController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/api/app/Controller/EventsController.php b/web/api/app/Controller/EventsController.php index f180fc5fe..89c5bdd32 100644 --- a/web/api/app/Controller/EventsController.php +++ b/web/api/app/Controller/EventsController.php @@ -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');