Skip to content
Snippets Groups Projects
Commit 08e4a4c8 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V4.0.2: Old php versions do not support using array elements directly for...

V4.0.2: Old php versions do not support using array elements directly for function calls. We need to use call_user_func_array instead, otherwise we get an error "Function name must be a string"...
parent 7e8de8be
No related branches found
No related tags found
No related merge requests found
BASE=ordernumber BASE=ordernumber
PLUGINTYPE=vmshopper PLUGINTYPE=vmshopper
VERSION=4.0.1 VERSION=4.0.2
PLUGINFILES=$(BASE).php ordernumber_helper_joomla.php $(BASE).script.php $(BASE).xml index.html library/ PLUGINFILES=$(BASE).php ordernumber_helper_joomla.php $(BASE).script.php $(BASE).xml index.html library/
......
...@@ -103,7 +103,7 @@ class OrdernumberHelper { ...@@ -103,7 +103,7 @@ class OrdernumberHelper {
public function __($string) { public function __($string) {
if (isset($this->callbacks["translate"])) { if (isset($this->callbacks["translate"])) {
return $this->callbacks["translate"]($string); return call_user_func_array($this->callbacks['translate'], func_get_args());
} else { } else {
return $string; return $string;
} }
...@@ -142,7 +142,7 @@ class OrdernumberHelper { ...@@ -142,7 +142,7 @@ class OrdernumberHelper {
public function urlPath($type, $file) { public function urlPath($type, $file) {
if (isset($this->callbacks['urlPath'])) { if (isset($this->callbacks['urlPath'])) {
return $this->callbacks['urlPath']($type, $file); return call_user_func_array($this->callbacks['urlPath'], func_get_args());
} else { } else {
throw new Exception('No callback defined for urlPath(type, file)!'); throw new Exception('No callback defined for urlPath(type, file)!');
} }
...@@ -150,13 +150,13 @@ class OrdernumberHelper { ...@@ -150,13 +150,13 @@ class OrdernumberHelper {
protected function replacementsCallback ($func, &$reps, $details, $nrtype) { protected function replacementsCallback ($func, &$reps, $details, $nrtype) {
if (isset($this->callbacks[$func])) { if (isset($this->callbacks[$func])) {
return $this->callbacks[$func]($reps, $details, $nrtype); return call_user_func_array($this->callbacks[$func], array($reps, $details, $nrtype));
} }
} }
protected function getCounter($type, $countername, $default) { protected function getCounter($type, $countername, $default) {
if (isset($this->callbacks['getCounter'])) { if (isset($this->callbacks['getCounter'])) {
return $this->callbacks['getCounter']($type, $countername, $default); return call_user_func_array($this->callbacks['getCounter'], func_get_args());
} else { } else {
throw new Exception('No callback defined for getCounter(type, countername, default)!'); throw new Exception('No callback defined for getCounter(type, countername, default)!');
} }
...@@ -164,15 +164,15 @@ class OrdernumberHelper { ...@@ -164,15 +164,15 @@ class OrdernumberHelper {
protected function setCounter($type, $countername, $value) { protected function setCounter($type, $countername, $value) {
if (isset($this->callbacks['getCounter'])) { if (isset($this->callbacks['getCounter'])) {
return $this->callbacks['getCounter']($type, $countername, $value); return call_user_func_array($this->callbacks['setCounter'], func_get_args());
} else { } else {
throw new Exception('No callback defined for setCounter(type, countername, value)!'); throw new Exception('No callback defined for setCounter(type, countername, value)!');
} }
} }
public function getAllCounters($type) { public function getAllCounters($type) {
if (isset($this->callbacks['getCounter'])) { if (isset($this->callbacks['getAllCounters'])) {
return $this->callbacks['getCounter']($type); return call_user_func_array($this->callbacks['getAllCounters'], func_get_args());
} else { } else {
throw new Exception ('No callback defined for getAllCounters(type)!'); throw new Exception ('No callback defined for getAllCounters(type)!');
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<authorUrl>http://www.open-tools.net/</authorUrl> <authorUrl>http://www.open-tools.net/</authorUrl>
<copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright> <copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license> <license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license>
<version>4.0.1</version> <version>4.0.2</version>
<releaseDate>2015-05-23</releaseDate> <releaseDate>2015-05-23</releaseDate>
<releaseType>Minor update</releaseType> <releaseType>Minor update</releaseType>
<downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl> <downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl>
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment