From 0e6f07b4af3e087a5dcad3cb7ffd4cd6ee90f6f5 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Tue, 4 Sep 2018 15:44:53 +0100 Subject: [PATCH 1/2] Fix issue with PHP 7.2 & LazyProduct --- ps_legalcompliance.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ps_legalcompliance.php b/ps_legalcompliance.php index da40e3b..5d1ab8d 100644 --- a/ps_legalcompliance.php +++ b/ps_legalcompliance.php @@ -45,8 +45,8 @@ class Ps_LegalCompliance extends Module protected $entity_manager; protected $filesystem; protected $emails; - protected $_errors; - protected $_warnings; + protected $_errors = array(); + protected $_warnings = array(); /* Constants used for LEGAL/CMS Management */ const LEGAL_NO_ASSOC = 'NO_ASSOC'; @@ -860,7 +860,7 @@ public function hookDisplayProductPriceBlock($param) $product = $param['product']; $hook_type = $param['type']; - if (is_array($product)) { + if (! $product instanceof Product) { $product_repository = $this->entity_manager->getRepository('Product'); $product = $product_repository->findOne((int) $product['id_product']); } From 17e3f11b5e294b4e2f08e1a7a675f55fef336a43 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Tue, 4 Sep 2018 15:45:58 +0100 Subject: [PATCH 2/2] Bump to v3.0.1 --- config.xml | 2 +- ps_legalcompliance.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index d73dac4..c3c0752 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ ps_legalcompliance - + diff --git a/ps_legalcompliance.php b/ps_legalcompliance.php index 5d1ab8d..0230ee3 100644 --- a/ps_legalcompliance.php +++ b/ps_legalcompliance.php @@ -64,7 +64,7 @@ public function __construct(EntityManager $entity_manager, { $this->name = 'ps_legalcompliance'; $this->tab = 'administration'; - $this->version = '3.0.0'; + $this->version = '3.0.1'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true;