mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +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();
|
parent::onBeforeDelete();
|
||||||
|
|
||||||
// If deleting this page, delete all its children.
|
// 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) {
|
foreach($children as $child) {
|
||||||
$child->delete();
|
$child->delete();
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ Page:
|
|||||||
Title: Staff
|
Title: Staff
|
||||||
URLSegment: my-staff
|
URLSegment: my-staff
|
||||||
Parent: =>Page.about
|
Parent: =>Page.about
|
||||||
|
ShowInMenus: 0
|
||||||
products:
|
products:
|
||||||
Title: Products
|
Title: Products
|
||||||
CanEditType: OnlyTheseUsers
|
CanEditType: OnlyTheseUsers
|
||||||
|
Loading…
Reference in New Issue
Block a user