mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG: Replaced extendedSQL/buildSQL with DataList as per ticket 8183
BUG: Correcting the4 case of a function Corrcting the case of a function BUG: replaced deprecated extendedSQL call with DataList->where
This commit is contained in:
parent
072b485f66
commit
e1e64839e2
@ -76,8 +76,7 @@ class Aggregate extends ViewableData {
|
|||||||
* @return SQLQuery
|
* @return SQLQuery
|
||||||
*/
|
*/
|
||||||
protected function query($attr) {
|
protected function query($attr) {
|
||||||
$singleton = singleton($this->type);
|
$query = DataList::create($this->type)->where($this->filter);
|
||||||
$query = $singleton->buildSQL($this->filter);
|
|
||||||
$query->setSelect($attr);
|
$query->setSelect($attr);
|
||||||
$query->setOrderBy(array());
|
$query->setOrderBy(array());
|
||||||
$singleton->extend('augmentSQL', $query);
|
$singleton->extend('augmentSQL', $query);
|
||||||
|
@ -1434,7 +1434,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
$combinedFilter = "\"$joinField\" = '$id'";
|
$combinedFilter = "\"$joinField\" = '$id'";
|
||||||
if(!empty($filter)) $combinedFilter .= " AND ({$filter})";
|
if(!empty($filter)) $combinedFilter .= " AND ({$filter})";
|
||||||
|
|
||||||
return singleton($componentClass)->extendedSQL($combinedFilter, $sort, $limit, $join);
|
return DataList::create($componentClass)
|
||||||
|
->where($combinedFilter)
|
||||||
|
->canSortBy($sort)
|
||||||
|
->limit($limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +111,7 @@ class DataQuery {
|
|||||||
user_error("DataObjects have been requested before the manifest is loaded. Please ensure you are not"
|
user_error("DataObjects have been requested before the manifest is loaded. Please ensure you are not"
|
||||||
. " querying the database in _config.php.", E_USER_ERROR);
|
. " querying the database in _config.php.", E_USER_ERROR);
|
||||||
} else {
|
} else {
|
||||||
user_error("DataObject::buildSQL: Can't find data classes (classes linked to tables) for"
|
user_error("DataList::create Can't find data classes (classes linked to tables) for"
|
||||||
. " $this->dataClass. Please ensure you run dev/build after creating a new DataObject.",
|
. " $this->dataClass. Please ensure you run dev/build after creating a new DataObject.",
|
||||||
E_USER_ERROR);
|
E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user