mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG: augmentSQL always extended on base data class on query finalization
The augmentSQL DataExtension method is always extended on the base data class of data objects in DataQuery::getFinilisedQuery(). This results in augmentSQL not being called for extensions that are applied to non- base data classes when finalizing the query. For example, if Versioned was applied to class B which extends class A, which in turn extends DataObject, then augmentSQL would be extended for class A in DataQuery::getFinilisedQuery(). Since class A doesn't have the Versioned extension in this example, it would not work for class B. Fixed this by extending augmentSQL on the actual data class and not on the base class.
This commit is contained in:
parent
bbb0868227
commit
76c5b56e81
@ -227,7 +227,7 @@ class DataQuery {
|
||||
|
||||
// TODO: Versioned, Translatable, SiteTreeSubsites, etc, could probably be better implemented as subclasses of DataQuery
|
||||
|
||||
$obj = Injector::inst()->get(ClassInfo::baseDataClass($this->dataClass));
|
||||
$obj = Injector::inst()->get($this->dataClass);
|
||||
$obj->extend('augmentSQL', $query, $this);
|
||||
|
||||
$this->ensureSelectContainsOrderbyColumns($query);
|
||||
|
Loading…
x
Reference in New Issue
Block a user