From 0c9db7a6a28bbd67e85ea2f26f83089be90e0b74 Mon Sep 17 00:00:00 2001 From: Robbie Mackay Date: Wed, 11 Mar 2015 15:34:23 +1300 Subject: [PATCH] Allow filtering by multiple forms Refs T773 --- application/classes/Ushahidi/Repository/Post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/classes/Ushahidi/Repository/Post.php b/application/classes/Ushahidi/Repository/Post.php index b156cc16cd..033d9648dd 100644 --- a/application/classes/Ushahidi/Repository/Post.php +++ b/application/classes/Ushahidi/Repository/Post.php @@ -163,7 +163,10 @@ protected function setSearchConditions(SearchData $search) { if ($search->$key) { - $query->where("$table.{$key}_id", '=', $search->$key); + if (!is_array($search->$key)) { + $search->$key = explode(',', $search->$key); + } + $query->where("$table.{$key}_id", 'IN', $search->$key); } }