Skip to content

Commit 287d5cf

Browse files
committed
fix: include_once is now placed outside the loop
1 parent 7c6e1ed commit 287d5cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

htdocs/class/theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ protected function loadMenus()
486486
if (!is_object($menusitemsHandler) && class_exists('XoopsMenusItemsHandler')) {
487487
$menusitemsHandler = new XoopsMenusItemsHandler($GLOBALS['xoopsDB']);
488488
}
489+
include_once $GLOBALS['xoops']->path('class/tree.php');
489490
foreach ($category_arr as $cat) {
490491
try {
491492
$cid = $cat->getVar('category_id');
@@ -497,7 +498,6 @@ protected function loadMenus()
497498
$crit->setSort('items_position, items_title');
498499
$crit->setOrder('ASC');
499500
$items_arr = $menusitemsHandler->getAll($crit);
500-
include_once $GLOBALS['xoops']->path('class/tree.php');
501501
$myTree = new XoopsObjectTree($items_arr, 'items_id', 'items_pid');
502502
// recursive closure to build nested structure
503503
$buildNested = function ($treeObj, $parentId = 0) use (&$buildNested) {

0 commit comments

Comments
 (0)