File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
application/classes/Ushahidi/Repository Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -211,15 +211,17 @@ protected function setSearchConditions(SearchData $search)
211
211
$ query = $ this ->search_query ;
212
212
$ table = $ this ->getTable ();
213
213
214
- $ status = $ search ->getFilter ('status ' , 'published ' );
215
- if ($ status !== 'all ' )
216
- {
217
- if (!is_array ($ status )) {
218
- $ status = explode (', ' , $ status );
219
- }
220
-
214
+ // Filter by status
215
+ $ status = $ search ->getFilter ('status ' , ['published ' ]);
216
+ //
217
+ if (!is_array ($ status )) {
218
+ $ status = explode (', ' , $ status );
219
+ }
220
+ // If array contains 'all' don't bother filtering
221
+ if (!in_array ('all ' , $ status )) {
221
222
$ query ->where ("$ table.status " , 'IN ' , $ status );
222
223
}
224
+ // End filter by status
223
225
224
226
foreach (['type ' , 'locale ' , 'slug ' ] as $ key )
225
227
{
You can’t perform that action at this time.
0 commit comments