From 6d2b42f5e29510a00f2dddc4c40f0be033148182 Mon Sep 17 00:00:00 2001 From: Igor Goltsov Date: Mon, 13 Dec 2021 12:38:37 +0300 Subject: [PATCH] MPGS-610 [Simplify] [PrestaShop] Module installation issue | Fails in 1st attempt but installing successfully in 2nd attempt --- .gitignore | 2 +- Makefile | 4 ++-- simplifycommerce.php | 10 ++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 534038d..8c871de 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,6 @@ node_modules/ errorShots/ config.xml -/prestashop-simplifycommerce.zip +/simplifycommerce.zip *.less *.css.map diff --git a/Makefile b/Makefile index 11ac884..42e735d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ all : - git archive HEAD --prefix=simplifycommerce/ -o ./prestashop-simplifycommerce.zip &&\ - echo "\nCreated prestashop-simplifycommerce.zip\n" + git archive HEAD --prefix=simplifycommerce/ -o ./simplifycommerce.zip &&\ + echo "\nCreated simplifycommerce.zip\n" diff --git a/simplifycommerce.php b/simplifycommerce.php index 9ef92ed..1eb4b92 100644 --- a/simplifycommerce.php +++ b/simplifycommerce.php @@ -311,6 +311,12 @@ public function hookDisplayAdminOrderLeft($params) return $this->display(__FILE__, 'views/templates/hook/order_actions.tpl'); } + /** + * @return bool + * + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ public function installOrderState() { if (!Configuration::get('SIMPLIFY_OS_AUTHORIZED') @@ -332,9 +338,9 @@ public function installOrderState() $destination = _PS_ROOT_DIR_.'/img/os/'.(int)$order_state->id.'.gif'; copy($source, $destination); } - - Configuration::updateValue('SIMPLIFY_OS_AUTHORIZED', (int)$order_state->id); + return Configuration::updateValue('SIMPLIFY_OS_AUTHORIZED', (int)$order_state->id); } + return true; } /**