From 78ff226a17a24166e83e67873129db30ad2bca27 Mon Sep 17 00:00:00 2001 From: Vitaly Artemev Date: Mon, 12 Dec 2016 20:42:21 +0400 Subject: [PATCH] bugfix address --- .../classes/retailcrm/RCrmActions.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/classes/modules/RetailCRM/classes/retailcrm/RCrmActions.php b/classes/modules/RetailCRM/classes/retailcrm/RCrmActions.php index 1b7f6f5..adad6b8 100644 --- a/classes/modules/RetailCRM/classes/retailcrm/RCrmActions.php +++ b/classes/modules/RetailCRM/classes/retailcrm/RCrmActions.php @@ -131,15 +131,23 @@ class RCrmActions $deliveryNotes = $deliveryObj->getValue('order_comments'); if ($deliveryObj->getValue('region') !== null) { - $deliveryRegionObj = new umiObject($deliveryObj->getValue('region')); - $deliveryRegion = $deliveryRegionObj->getName(); + try { + $deliveryRegionObj = new umiObject($deliveryObj->getValue('region')); + $deliveryRegion = $deliveryRegionObj->getName(); + } catch (Exception $e) { + $deliveryRegion = $deliveryObj->getValue('region'); + } } else { $deliveryRegion = ''; } if ($deliveryObj->getValue('city') !== null) { - $deliveryCityObj = new umiObject($deliveryObj->getValue('city')); - $deliveryCity = $deliveryCityObj->getName(); + try { + $deliveryCityObj = new umiObject($deliveryObj->getValue('city')); + $deliveryCity = $deliveryCityObj->getName(); + } catch (Exception $e) { + $deliveryCity = $deliveryObj->getValue('city'); + } } else { $deliveryCity = ''; } @@ -262,4 +270,4 @@ class RCrmActions return $orderToCrm; } -} \ No newline at end of file +}