From 1609669f77fc1bf751dd8f6811d7b999dbf1c6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Werner=20M=2E=20Krau=C3=9F?= Date: Tue, 11 Sep 2018 15:21:43 +0200 Subject: [PATCH] php 7.2 compatibility --- code/cart/ShoppingCart.php | 4 ++-- code/cms/ShopConfig.php | 2 +- code/model/Order.php | 2 +- code/product/Product.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/cart/ShoppingCart.php b/code/cart/ShoppingCart.php index 94e9e2b04..454e4f466 100644 --- a/code/cart/ShoppingCart.php +++ b/code/cart/ShoppingCart.php @@ -566,9 +566,9 @@ protected static function build_url($action, $buyable, $params = array()) * * you will need to decode the url with javascript before using it. */ - protected static function params_to_get_string($array) + protected static function params_to_get_string(array $array) { - if ($array & count($array > 0)) { + if ($array && count($array) > 0) { array_walk($array, create_function('&$v,$k', '$v = $k."=".$v ;')); return "?" . implode("&", $array); } diff --git a/code/cms/ShopConfig.php b/code/cms/ShopConfig.php index 400b90ec8..63560fae5 100644 --- a/code/cms/ShopConfig.php +++ b/code/cms/ShopConfig.php @@ -81,7 +81,7 @@ public function getCountriesList($prefixisocode = false) asort($countries); if ($allowed = $this->owner->AllowedCountries) { $allowed = explode(",", $allowed); - if (count($allowed > 0)) { + if (count($allowed) > 0) { $countries = array_intersect_key($countries, array_flip($allowed)); } } diff --git a/code/model/Order.php b/code/model/Order.php index 22d6e5e82..22d87c892 100644 --- a/code/model/Order.php +++ b/code/model/Order.php @@ -299,7 +299,7 @@ public function getDefaultSearchContext() /** * Hack for swapping out relation list with OrderItemList */ - public function getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null) + public function getComponents($componentName, $filter = null, $sort = null, $join = null, $limit = null) { $components = parent::getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null); if ($componentName === "Items" && get_class($components) !== "UnsavedRelationList") { diff --git a/code/product/Product.php b/code/product/Product.php index bbbc5a946..cefed39fc 100644 --- a/code/product/Product.php +++ b/code/product/Product.php @@ -382,9 +382,9 @@ public function isOrphaned() return false; } - public function Link() + public function Link($action = null) { - $link = parent::Link(); + $link = parent::Link($action); $this->extend('updateLink', $link); return $link; }