Merge remote-tracking branch 'origin/4.1' into 4

This commit is contained in:
Damian Mooyman 2018-03-13 14:35:13 +13:00
commit 90723a2f07
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
3 changed files with 13 additions and 7 deletions

View File

@ -150,9 +150,12 @@ excludedPaths:
- '*/_config/legacy.yml' - '*/_config/legacy.yml'
warnings: warnings:
methods: methods:
'SilverStripe\CMS\Model\SiteTree::getIsAddedToStage()': 'SilverStripe\CMS\Model\SiteTree->getIsAddedToStage()':
message: 'Moved to Versioned->isOnDraftOnly()' message: 'Moved to Versioned->isOnDraftOnly()'
'SilverStripe\CMS\Model\SiteTree::getIsModifiedOnStage()': replacement: 'isOnDraftOnly'
'SilverStripe\CMS\Model\SiteTree->getIsModifiedOnStage()':
message: 'Moved to Versioned->isModifiedOnDraft()' message: 'Moved to Versioned->isModifiedOnDraft()'
'SilverStripe\CMS\Model\SiteTree::getExistsOnLive()': replacement: 'isModifiedOnDraft'
'SilverStripe\CMS\Model\SiteTree->getExistsOnLive()':
message: 'Removed in favour of isPublished()' message: 'Removed in favour of isPublished()'
replacement: 'isPublished'

View File

@ -773,8 +773,8 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
public function InSection($sectionName) public function InSection($sectionName)
{ {
$page = Director::get_current_page(); $page = Director::get_current_page();
while ($page && $page->exists()) { while ($page instanceof SiteTree && $page->exists()) {
if ($sectionName == $page->URLSegment) { if ($sectionName === $page->URLSegment) {
return true; return true;
} }
$page = $page->Parent(); $page = $page->Parent();

View File

@ -12,7 +12,6 @@ use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ValidationResult; use SilverStripe\ORM\ValidationResult;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\Versioned\Versioned; use SilverStripe\Versioned\Versioned;
use SilverStripe\View\SSViewer;
/** /**
* Virtual Page creates an instance of a page, with the same fields that the original page had, but readonly. * Virtual Page creates an instance of a page, with the same fields that the original page had, but readonly.
@ -366,7 +365,11 @@ class VirtualPage extends Page
public function CMSTreeClasses() public function CMSTreeClasses()
{ {
return parent::CMSTreeClasses() . ' VirtualPage-' . $this->CopyContentFrom()->ClassName; $parentClass = sprintf(
' VirtualPage-%s',
Convert::raw2htmlid($this->CopyContentFrom()->ClassName)
);
return parent::CMSTreeClasses() . $parentClass;
} }
/** /**