mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #1027 from rodneyway/1026-SiteTree-page-delete-omits-children-with-ShowInMenus-off
Ensure that all child pages are deleted (regardless of their ShowInMenu ...
This commit is contained in:
commit
a1286f1c0f
@ -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