BUGFIX: Made Hierarchy::liveChildren() db-agnostic

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76366 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-07 05:57:34 +00:00
parent f7155ff580
commit edf59a8667

View File

@ -539,7 +539,7 @@ class Hierarchy extends DataObjectDecorator {
* @return DataObjectSet
*/
public function liveChildren($showAll = false) {
$extraFilter = $showAll ? '' : " AND \"ShowInMenus\"";
$extraFilter = $showAll ? '' : " AND \"ShowInMenus\"=1";
$baseClass = ClassInfo::baseDataClass($this->owner->class);
return Versioned::get_by_stage($baseClass, "Live", "\"{$baseClass}\".\"ParentID\" = " . (int)$this->owner->ID . " AND \"{$baseClass}\".\"ID\" != " . (int)$this->owner->ID. $extraFilter, "");
}