mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Fixed BacklinkTracking filter usage
Previous deprecation fixes made this method error out when called on the root node (ID=0), so when admin/assets is first called.
This commit is contained in:
parent
812a921072
commit
94d354de4a
@ -72,10 +72,13 @@ class SiteTreeFileExtension extends DataExtension {
|
|||||||
Please manipluate the returned list directly.', Deprecation::SCOPE_GLOBAL);
|
Please manipluate the returned list directly.', Deprecation::SCOPE_GLOBAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$links = $this->owner->getManyManyComponents('BackLinkTracking')
|
$links = $this->owner->getManyManyComponents('BackLinkTracking');
|
||||||
->where($filter)
|
if($this->owner->ID) {
|
||||||
->sort($sort)
|
$links = $links
|
||||||
->limit($limit);
|
->where($filter)
|
||||||
|
->sort($sort)
|
||||||
|
->limit($limit);
|
||||||
|
}
|
||||||
$this->owner->extend('updateBackLinkTracking', $links);
|
$this->owner->extend('updateBackLinkTracking', $links);
|
||||||
|
|
||||||
if(class_exists("Subsite")){
|
if(class_exists("Subsite")){
|
||||||
|
Loading…
Reference in New Issue
Block a user