From 3b80b9dd75608f189d074ea923c8325bd732e201 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 16:37:52 +0100 Subject: [PATCH] Fix regression --- htdocs/core/class/hookmanager.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index ff6d364b8fe..cef41497381 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -131,7 +131,9 @@ class HookManager dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG); } - ksort($this->hooks[$context], SORT_NATURAL); + if (!empty($this->hooks[$context])) { + ksort($this->hooks[$context], SORT_NATURAL); + } return 1; }