mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Checking for existence of "ShowInMenus" property in Folder->liveChildren() and stageChildren() (#5190) (from r101264)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111978 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1dcc5401f6
commit
0d5a0e73fe
@ -512,11 +512,18 @@ class Hierarchy extends DataObjectDecorator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return children from the stage site
|
* Return children from the stage site
|
||||||
|
*
|
||||||
* @param showAll Inlcude all of the elements, even those not shown in the menus.
|
* @param showAll Inlcude all of the elements, even those not shown in the menus.
|
||||||
|
* (only applicable when extension is applied to {@link SiteTree}).
|
||||||
* @return DataObjectSet
|
* @return DataObjectSet
|
||||||
*/
|
*/
|
||||||
public function stageChildren($showAll = false) {
|
public function stageChildren($showAll = false) {
|
||||||
$extraFilter = $showAll ? '' : " AND \"ShowInMenus\"=1";
|
if($this->owner->db('ShowInMenus')) {
|
||||||
|
$extraFilter = ($showAll) ? '' : " AND \"ShowInMenus\"=1";
|
||||||
|
} else {
|
||||||
|
$extraFilter = '';
|
||||||
|
}
|
||||||
|
|
||||||
$baseClass = ClassInfo::baseDataClass($this->owner->class);
|
$baseClass = ClassInfo::baseDataClass($this->owner->class);
|
||||||
|
|
||||||
$staged = DataObject::get($baseClass, "\"{$baseClass}\".\"ParentID\" = "
|
$staged = DataObject::get($baseClass, "\"{$baseClass}\".\"ParentID\" = "
|
||||||
@ -530,12 +537,18 @@ class Hierarchy extends DataObjectDecorator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return children from the live site, if it exists.
|
* Return children from the live site, if it exists.
|
||||||
|
*
|
||||||
* @param boolean $showAll Include all of the elements, even those not shown in the menus.
|
* @param boolean $showAll Include all of the elements, even those not shown in the menus.
|
||||||
|
* (only applicable when extension is applied to {@link SiteTree}).
|
||||||
* @param boolean $onlyDeletedFromStage Only return items that have been deleted from stage
|
* @param boolean $onlyDeletedFromStage Only return items that have been deleted from stage
|
||||||
* @return DataObjectSet
|
* @return DataObjectSet
|
||||||
*/
|
*/
|
||||||
public function liveChildren($showAll = false, $onlyDeletedFromStage = false) {
|
public function liveChildren($showAll = false, $onlyDeletedFromStage = false) {
|
||||||
$extraFilter = $showAll ? '' : " AND \"ShowInMenus\"=1";
|
if($this->owner->db('ShowInMenus')) {
|
||||||
|
$extraFilter = ($showAll) ? '' : " AND \"ShowInMenus\"=1";
|
||||||
|
} else {
|
||||||
|
$extraFilter = '';
|
||||||
|
}
|
||||||
$join = "";
|
$join = "";
|
||||||
|
|
||||||
$baseClass = ClassInfo::baseDataClass($this->owner->class);
|
$baseClass = ClassInfo::baseDataClass($this->owner->class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user