diff --git a/Makefile b/Makefile index f11292a8cfbad29580d1a0045d1b92b4384b40ab..7a169e17f707178347cd96f35e4446d5815de663 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ BASE=rules_shipping BASE_ADV=rules_shipping_advanced PLUGINTYPE=vmshipment ZIPBASE=opentools_vm -VERSION=6.1.1 +VERSION=6.1.2 PLUGINFILES=$(BASE).php $(BASE)_base.php $(BASE)_framework_joomla.php $(BASE).script.php $(BASE).xml index.html PLUGINFILES_ADV=$(BASE_ADV).php $(BASE)_base.php $(BASE)_framework_joomla.php $(BASE_ADV).script.php $(BASE_ADV).xml index.html diff --git a/library/rules_shipping_framework.php b/library/rules_shipping_framework.php index aa0ebb44b0099adac392463662dc6f25537e865e..ea880ecd2b54654e905f73a9c51e99f3b4ad7f83 100644 --- a/library/rules_shipping_framework.php +++ b/library/rules_shipping_framework.php @@ -51,7 +51,7 @@ function is_equal($a, $b) { class RulesShippingFramework { static $_version = "0.1"; - protected $_callbacks = array(); + protected $callbacks = array(); // Store the parsed and possibly evaluated rules for each method (method ID is used as key) protected $rules = array(); protected $match = array(); @@ -334,8 +334,9 @@ class RulesShippingFramework { /** Allow child classes to add additional variables for the rules or modify existing one */ protected function addCustomCartValues ($cart, $products, $method, &$values) { + // Pass all args through to the callback, if it exists if (isset($this->callbacks['addCustomCartValues'])) { - return $this->callbacks['addCustomCartValues']($cart, $products, $method, $values); + return call_user_func_array($this->callbacks['addCustomCartValues'], func_get_args()); } } protected function addPluginCartValues($cart, $products, $method, &$values) { @@ -535,7 +536,8 @@ class RulesShippingFramework { protected function createMethodRule ($r, $countries, $ruleinfo) { if (isset($this->callbacks['initRule'])) { - return $this->callbacks['initRule']($this, $r, $countries, $ruleinfo); + return call_user_func_array($this->callbacks['initRule'], + array($this, $r, $countries, $ruleinfo)); } else { return new ShippingRule($this, $r, $countries, $ruleinfo); } diff --git a/releases/plg_opentools_vm_rules_shipping_advanced_v6.1.2.zip b/releases/plg_opentools_vm_rules_shipping_advanced_v6.1.2.zip new file mode 100644 index 0000000000000000000000000000000000000000..2f3826b9bfadf4866d894deb189a6e8cbae1710b Binary files /dev/null and b/releases/plg_opentools_vm_rules_shipping_advanced_v6.1.2.zip differ diff --git a/releases/plg_opentools_vm_rules_shipping_v6.1.2.zip b/releases/plg_opentools_vm_rules_shipping_v6.1.2.zip new file mode 100644 index 0000000000000000000000000000000000000000..df998ae2d63905a4c4a5fb095131eb0c75e2d743 Binary files /dev/null and b/releases/plg_opentools_vm_rules_shipping_v6.1.2.zip differ diff --git a/rules_shipping.xml b/rules_shipping.xml index 79e372fe5747f578d6b5f71468b79e2eb8864eb8..f15f0c05d0dd187a9e4ae4be2e0738fda18f5b60 100644 --- a/rules_shipping.xml +++ b/rules_shipping.xml @@ -6,7 +6,7 @@ <authorUrl>http://www.open-tools.net</authorUrl> <copyright>Copyright (C) 2013-2014, Reinhold Kainhofer</copyright> <license>GPL v3+</license> - <version>6.1.1</version> + <version>6.1.2</version> <description>OTSHIPMENT_RULES_DESC</description> <files> <filename plugin="rules_shipping">rules_shipping.php</filename> diff --git a/rules_shipping_advanced.xml b/rules_shipping_advanced.xml index 2d03d26e9ba73c4e2d4f30ca2255b0a8a15aaa2e..b3524b7c0dc7cb3c1a037473e877d8b3d2c60ab9 100644 --- a/rules_shipping_advanced.xml +++ b/rules_shipping_advanced.xml @@ -6,7 +6,7 @@ <authorUrl>http://www.open-tools.net</authorUrl> <copyright>Copyright (C) 2013-2014, Reinhold Kainhofer</copyright> <license>GPL v3+</license> - <version>6.1.1</version> + <version>6.1.2</version> <description>OTSHIPMENT_RULES_ADV_DESC</description> <files> <filename plugin="rules_shipping_advanced">rules_shipping_advanced.php</filename>