mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUG: Ensure that all child pages are deleted (regardless of ShowInMenu status) under enforce_strict_hierarchy.
Also updated SiteTree YML test data to match.
This commit is contained in:
parent
601efbc088
commit
1e194854e0
@ -1562,7 +1562,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
parent::onBeforeDelete();
|
||||
|
||||
// If deleting this page, delete all its children.
|
||||
if(SiteTree::config()->enforce_strict_hierarchy && $children = $this->Children()) {
|
||||
if(SiteTree::config()->enforce_strict_hierarchy && $children = $this->AllChildren()) {
|
||||
foreach($children as $child) {
|
||||
$child->delete();
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ Page:
|
||||
Title: Staff
|
||||
URLSegment: my-staff
|
||||
Parent: =>Page.about
|
||||
ShowInMenus: 0
|
||||
products:
|
||||
Title: Products
|
||||
CanEditType: OnlyTheseUsers
|
||||
|
Loading…
Reference in New Issue
Block a user