From e7c75335741104fb17781110754c1ba5e3959cae Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer <reinhold@kainhofer.com> Date: Mon, 19 Jun 2017 01:20:52 +0200 Subject: [PATCH] Flattening an empty list with call_user_func_array does not work (warning), so we need to add a check... --- rules_shipping_framework_joomla.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rules_shipping_framework_joomla.php b/rules_shipping_framework_joomla.php index eeb6f71..eea9dec 100644 --- a/rules_shipping_framework_joomla.php +++ b/rules_shipping_framework_joomla.php @@ -37,7 +37,11 @@ class RulesShippingFrameworkJoomla extends RulesShippingFramework { // ...); JPluginHelper::importPlugin('vmshipmentrules'); $dispatcher = JDispatcher::getInstance(); - $custfuncdefs = call_user_func_array('array_merge', $dispatcher->trigger('onVmShippingRulesRegisterCustomFunctions',array())); + $defs = $dispatcher->trigger('onVmShippingRulesRegisterCustomFunctions',array()); + $custfuncdefs = array(); + if (!empty($defs)) { + $custfuncdefs = call_user_func_array('array_merge', $defs); + } $custfuncdefs['convertfromcurrency'] = array($this, 'convert_from_currency'); $custfuncdefs['converttocurrency'] = array($this, 'convert_to_currency'); -- GitLab