mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge pull request #496 from creative-commoners/pulls/2.7-release/historyviewer
FIX Do not show copy to subsite buttons in history viewer
This commit is contained in:
commit
a7e9e8dcdc
@ -29,6 +29,7 @@ use SilverStripe\Subsites\Model\Subsite;
|
||||
use SilverStripe\Subsites\Service\ThemeResolver;
|
||||
use SilverStripe\Subsites\State\SubsiteState;
|
||||
use SilverStripe\View\SSViewer;
|
||||
use SilverStripe\VersionedAdmin\Controllers\HistoryViewerController;
|
||||
|
||||
/**
|
||||
* Extension for the SiteTree object to add subsites support
|
||||
@ -117,10 +118,12 @@ class SiteTreeSubsites extends DataExtension
|
||||
$subsitesMap = new Map(ArrayList::create());
|
||||
}
|
||||
|
||||
$viewingPageHistory = Controller::has_curr() && Controller::curr() instanceof HistoryViewerController;
|
||||
|
||||
// Master page edit field (only allowed from default subsite to avoid inconsistent relationships)
|
||||
$isDefaultSubsite = $this->owner->SubsiteID == 0 || $this->owner->Subsite()->DefaultSite;
|
||||
|
||||
if ($isDefaultSubsite && $subsitesMap->count()) {
|
||||
if ($isDefaultSubsite && $subsitesMap->count() && !$viewingPageHistory) {
|
||||
$fields->addFieldToTab(
|
||||
'Root.Main',
|
||||
ToggleCompositeField::create(
|
||||
|
Loading…
Reference in New Issue
Block a user