mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
FIX Implement correct subsites namespace in File extension
This commit is contained in:
parent
d5148e3b38
commit
157aef8eb7
@ -7,9 +7,9 @@ use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\ReadonlyField;
|
||||
use SilverStripe\ORM\DataExtension;
|
||||
use SilverStripe\ORM\ManyManyList;
|
||||
use SilverStripe\Subsites\Model\Subsite;
|
||||
use SilverStripe\Versioned\Versioned;
|
||||
use SilverStripe\View\SSViewer;
|
||||
use Subsite;
|
||||
|
||||
/**
|
||||
* Extension applied to {@see File} object to track links to {@see SiteTree} records.
|
||||
@ -74,7 +74,8 @@ class SiteTreeFileExtension extends DataExtension
|
||||
*/
|
||||
public function BackLinkTracking()
|
||||
{
|
||||
if (class_exists("Subsite")) {
|
||||
// @todo remove coupling with Subsites
|
||||
if (class_exists(Subsite::class)) {
|
||||
$rememberSubsiteFilter = Subsite::$disable_subsite_filter;
|
||||
Subsite::disable_subsite_filter(true);
|
||||
}
|
||||
@ -82,7 +83,7 @@ class SiteTreeFileExtension extends DataExtension
|
||||
$links = $this->owner->getManyManyComponents('BackLinkTracking');
|
||||
$this->owner->extend('updateBackLinkTracking', $links);
|
||||
|
||||
if (class_exists("Subsite")) {
|
||||
if (class_exists(Subsite::class)) {
|
||||
Subsite::disable_subsite_filter($rememberSubsiteFilter);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user