aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/lib/pages.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages/lib/pages.php')
-rw-r--r--mod/pages/lib/pages.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php
index 3f27118a6..9a9ba12e9 100644
--- a/mod/pages/lib/pages.php
+++ b/mod/pages/lib/pages.php
@@ -103,16 +103,18 @@ function pages_register_navigation_tree($container) {
'metadata_value' => $parent->getGUID(),
'limit' => 0,
));
-
- foreach ($children as $child) {
- elgg_register_menu_item('pages_nav', array(
- 'name' => $child->getGUID(),
- 'text' => $child->title,
- 'href' => $child->getURL(),
- 'parent_name' => $parent->getGUID(),
- ));
- array_push($stack, $child);
+
+ if ($children) {
+ foreach ($children as $child) {
+ elgg_register_menu_item('pages_nav', array(
+ 'name' => $child->getGUID(),
+ 'text' => $child->title,
+ 'href' => $child->getURL(),
+ 'parent_name' => $parent->getGUID(),
+ ));
+ array_push($stack, $child);
+ }
}
}
}
-} \ No newline at end of file
+}