From 6725f79cf67e358b6ef470508a10db005f997d63 Mon Sep 17 00:00:00 2001 From: gonzalo Date: Mon, 24 Apr 2017 14:24:13 -0300 Subject: [PATCH] add control if you enter an apikey first --- Helper/Data.php | 3 +++ composer.json | 2 +- etc/adminhtml/system.xml | 4 ++-- etc/module.xml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Helper/Data.php b/Helper/Data.php index 30a1994b..057d2860 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -581,6 +581,9 @@ public function loadStores() $apiKeys = $this->getConfigValue(self::XML_PATH_APIKEY_LIST); $keys = explode("\n", $apiKeys); foreach($keys as $apiKey) { + if(!$apiKey || $apiKey =='') { + continue; + } $this->_api->setApiKey(trim($apiKey)); $this->_api->setUserAgent('Mailchimp4Magento' . (string)$this->getModuleVersion()); $apiStores = $this->_api->ecommerce->stores->get(null,null,null,self::MAXSTORES); diff --git a/composer.json b/composer.json index d5855d73..db1518f0 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ }, "description": "Connect MailChimp with Magento", "type": "magento2-module", - "version": "1.0.5", + "version": "1.0.6", "authors": [ { "name": "Ebizmarts Corp", diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index fd9d5467..aa48f599 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -29,7 +29,7 @@ Magento\Config\Model\Config\Source\Yesno - + Ebizmarts\MailChimp\Model\Config\Backend\ApiKey Enterlist of API keys one per line @@ -54,7 +54,7 @@ 1 - + Ebizmarts\MailChimp\Model\Config\Source\MonkeyStore Ebizmarts\MailChimp\Model\Config\Backend\MonkeyStore diff --git a/etc/module.xml b/etc/module.xml index a889680e..9dd3ae6b 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -11,7 +11,7 @@ */ --> - +