From 59a89b250da4b2b6ac8465b07161355af3c5bb08 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 27 Dec 2017 11:56:58 +0100 Subject: [PATCH] Fix: avoid warning (https://github.com/Dolibarr/dolibarr/issues/7993) --- htdocs/core/lib/ajax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index dc86a2ef9f3..1fc5e23ebb4 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -414,7 +414,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ if ($forcefocus) $msg.= '.select2(\'focus\')'; $msg.= ';'."\n"; - if (count($events)) // If an array of js events to do were provided. + if (is_array($events) && count($events)) // If an array of js events to do were provided. { $msg.= ' jQuery("#'.$htmlname.'").change(function () {