Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: Fixed DataList operations to respect the fact that they're id…

…empotent.
  • Loading branch information...
commit 792c9058fa210ba0fd8e3fec4b812fffe988bd9c 1 parent c051b80
@sminnee sminnee authored
View
8 code/controllers/AssetAdmin.php
@@ -102,7 +102,7 @@ public function getList() {
// Re-add previously removed "Name" filter as combined filter
// TODO Replace with composite SearchFilter once that API exists
if(isset($params['Name'])) {
- $list->where(sprintf(
+ $list = $list->where(sprintf(
'"Name" LIKE \'%%%s%%\' OR "Title" LIKE \'%%%s%%\'',
Convert::raw2sql($params['Name']),
Convert::raw2sql($params['Name'])
@@ -110,12 +110,12 @@ public function getList() {
}
// Always show folders at the top
- $list->sort('(CASE WHEN "File"."ClassName" = \'Folder\' THEN 0 ELSE 1 END), "Name"');
+ $list = $list->sort('(CASE WHEN "File"."ClassName" = \'Folder\' THEN 0 ELSE 1 END), "Name"');
// If a search is conducted, check for the "current folder" limitation.
// Otherwise limit by the current folder as denoted by the URL.
if(!$params || @$params['CurrentFolderOnly']) {
- $list->filter('ParentID', $folder->ID);
+ $list = $list->filter('ParentID', $folder->ID);
}
// Category filter
@@ -124,7 +124,7 @@ public function getList() {
$categorySQLs = array();
foreach($exts as $ext) $categorySQLs[] = '"File"."Name" LIKE \'%.' . $ext . '\'';
// TODO Use DataList->filterAny() once OR connectives are implemented properly
- $list->where('(' . implode(' OR ', $categorySQLs) . ')');
+ $list = $list->where('(' . implode(' OR ', $categorySQLs) . ')');
}
return $list;
View
6 code/controllers/CMSMain.php
@@ -477,7 +477,7 @@ public function PageTypes() {
)));
}
- $result->sort('AddAction');
+ $result = $result->sort('AddAction');
return $result;
}
@@ -658,9 +658,9 @@ public function getList($params, $parentID = 0) {
foreach($pages=$filter->pagesIncluded() as $pageMap){
$ids[] = $pageMap['ID'];
}
- if(count($ids)) $list->where('"'.$this->stat('tree_class').'"."ID" IN ('.implode(",", $ids).')');
+ if(count($ids)) $list = $list->where('"'.$this->stat('tree_class').'"."ID" IN ('.implode(",", $ids).')');
} else {
- $list->filter("ParentID", is_numeric($parentID) ? $parentID : 0);
+ $list = $list->filter("ParentID", is_numeric($parentID) ? $parentID : 0);
}
return $list;
View
2  code/reports/BrokenLinksReport.php
@@ -69,7 +69,7 @@ function sourceRecords($params, $sort, $limit) {
}
}
- if($sortBrokenReason) $returnSet->sort('BrokenReason', $direction);
+ if($sortBrokenReason) $returnSet = $returnSet->sort('BrokenReason', $direction);
return $returnSet;
}
View
2  code/reports/Report.php
@@ -206,7 +206,7 @@ static function get_reports() {
$list = ArrayList::create($reportsArray);
//sort
- $list->sort('sort');
+ $list = $list->sort('sort');
return $list;
}
Please sign in to comment.
Something went wrong with that request. Please try again.