Permalink
Browse files

BUG AssetAdmin filter array indices (fixes #8014)

  • Loading branch information...
1 parent 2227e7d commit d58b23d6fa145bcd36af504240d38cede20de7fd @kmayo-ss kmayo-ss committed with chillu Nov 11, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 code/controllers/AssetAdmin.php
@@ -120,11 +120,13 @@ public function getList() {
// 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;

0 comments on commit d58b23d

Please sign in to comment.