BUG AssetAdmin filter array indices (fixes #8014)

This commit is contained in:
Kirk Mayo 2012-11-12 12:51:00 +13:00 committed by Ingo Schommer
parent 2227e7d152
commit d58b23d6fa
1 changed files with 4 additions and 2 deletions

View File

@ -120,11 +120,13 @@ JS
// Category filter
if(isset($params['AppCategory'])) {
$exts = File::$app_categories[$params['AppCategory']];
$exts = (isset(File::$app_categories[$params['AppCategory']])) ? File::$app_categories[$params['AppCategory']] : array();
$categorySQLs = array();
foreach($exts as $ext) $categorySQLs[] = '"File"."Name" LIKE \'%.' . $ext . '\'';
// TODO Use DataList->filterAny() once OR connectives are implemented properly
$list = $list->where('(' . implode(' OR ', $categorySQLs) . ')');
if (count($categorySQLs) > 0) {
$list = $list->where('(' . implode(' OR ', $categorySQLs) . ')');
}
}
return $list;