From ee420b79b1f7b532e33fa19aa4c63cb65864b895 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Jun 2016 17:49:20 +0200 Subject: [PATCH] FIX Infinite loop on menu tree output for edition FIX Can show tree of entries added by external modules using fk_mainmenu and fk_leftmenu instead of fk_menu. --- htdocs/core/lib/treeview.lib.php | 37 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index e900931037e..225568fd776 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -113,7 +113,11 @@ function tree_showpad(&$fulltree,$key,$silent=0) */ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree') { - if (empty($pere['rowid'])) + global $tree_recur_alreadyadded; + + if ($rang == 0) $tree_recur_alreadyadded=array(); + + if (empty($pere['rowid'])) { // Test also done with jstree and dynatree (not able to have inside label) print '