From c18375d7ee68d7f253fd5f659a2a68a0440ead06 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 5 Sep 2012 14:30:12 +0200 Subject: [PATCH] Fix: broken features $reshook may contain returns stacked by other modules $reshook is always empty with an array for can not lose returns stacked with other modules $hookmanager->resArray may contain array stacked by other modules --- htdocs/core/lib/files.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 074d18adfff..6affeeb29b9 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -85,9 +85,12 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil ); $reshook=$hookmanager->executeHooks('getDirList', $parameters); - if (! empty($reshook)) // If hook return non zero, it is a "replace code" hook. Otherwise, it is "insert code" hook. + // $reshook may contain returns stacked by other modules + // $reshook is always empty with an array for can not lose returns stacked with other modules + // $hookmanager->resArray may contain array stacked by other modules + if (! empty($hookmanager->resArray)) // forced to use $hookmanager->resArray even if $hookmanager->resArray['nodes'] is empty { - return $hookmanager->resArray; + return $hookmanager->resArray['nodes']; } else {