Skip to content

Commit

Permalink
Version 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Jun 16, 2023
1 parent 777b6ab commit 8872ae1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ To display delivery times, you must edit your template with:

## Copyright and Credits

- Current version: 3.3.0 (06/06/2023)
- Current version: 3.3.1 (16/06/2023)
- Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-soap": "*"
},
},
"replace": {
"kyrena/openmage-shippingmax-alone": "*",
"owebia/magento1-module-advanced-shipping": "*",
Expand Down
20 changes: 12 additions & 8 deletions src/app/code/community/Kyrena/Shippingmax/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/12/04/2019
* Updated L/24/04/2023
* Updated L/05/06/2023
*
* Copyright 2019-2023 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -311,7 +311,6 @@ public function updateFullFiles($cron = null, $force = false) {
$app = Mage::app();
$msg = [];

$hasError = false;
$address = new Varien_Object(['lat' => -1, 'lng' => -1]);
$carriers = Mage::getSingleton('shipping/config')->getAllCarriers();
$storeIds = Mage::getResourceModel('core/store_collection')->getAllIds(); // with admin
Expand Down Expand Up @@ -370,32 +369,37 @@ public function updateFullFiles($cron = null, $force = false) {
$msg[] = '- '.$code.': already up to date';
}

if (is_object($cron))
$cron->setData('messages', implode("\n", $msg))->save();

// global (ignore les autres stores)
continue 2;
}

$msg[] = '- '.$code.': disabled';
}
catch (Throwable $t) {
$hasError = true;
Mage::logException($t);
$msg[] = '- '.$code.': '.$t->getMessage();
if (is_object($cron))
$cron->setIsError(true);
}

if (is_object($cron))
$cron->setData('messages', $this->getCronMessage($msg))->save();
}
}

if (is_object($cron)) {
$cron->setData('messages', 'memory: '.((int) (memory_get_peak_usage(true) / 1024 / 1024)).'M (max: '.ini_get('memory_limit').')'."\n".implode("\n", $msg));
if ($hasError) // pour le statut du cron
$cron->setData('messages', $this->getCronMessage($msg));
if (!method_exists($cron, 'getIsError') && ($cron->getIsError() === true)) // without PR 3310
Mage::throwException('At least one error occurred while downloading files.'."\n\n".$cron->getData('messages')."\n\n");
}

return $msg;
}

protected function getCronMessage($msg) {
return 'memory: '.((int) (memory_get_peak_usage(true) / 1024 / 1024)).'M (max: '.ini_get('memory_limit').')'."\n".implode("\n", $msg);
}

// recherche l'id de la région
// recherche uniquement si la configuration indique que l'état est obligatoire
public function searchRegionId(string $country, $postcode = null, $name = null) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Kyrena/Shippingmax/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Created V/12/04/2019
* Updated L/24/04/2023
* Updated V/08/06/2023
*
* Copyright 2019-2023 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand All @@ -21,7 +21,7 @@
<config>
<modules>
<Kyrena_Shippingmax>
<version>3.3.0</version>
<version>3.3.1</version>
</Kyrena_Shippingmax>
</modules>
<global>
Expand Down

0 comments on commit 8872ae1

Please sign in to comment.