From f19b05786fffc91a96c85c6ce7caccf90e85f162 Mon Sep 17 00:00:00 2001 From: Santiago Date: Mon, 30 Sep 2019 15:37:06 -0300 Subject: [PATCH] Minor fixes. --- app/code/community/Ebizmarts/MailChimp/Helper/Data.php | 9 ++++----- .../community/Ebizmarts/MailChimp/Model/Api/Batches.php | 6 +++--- .../MailChimp/Model/System/Config/Source/List.php | 2 +- lib/Ebizmarts/MailChimp/Lists.php | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/code/community/Ebizmarts/MailChimp/Helper/Data.php b/app/code/community/Ebizmarts/MailChimp/Helper/Data.php index 2ce316c87..627c8cf93 100644 --- a/app/code/community/Ebizmarts/MailChimp/Helper/Data.php +++ b/app/code/community/Ebizmarts/MailChimp/Helper/Data.php @@ -4845,17 +4845,16 @@ public function getCountersSubscribers() public function modifyCounterDataSentToMailchimp($index, $hasError = false, $increment = 1) { $counterGetResponsesBatch = $this->getCountersDataSentToMailchimp(); - $counterGetResponsesBatchAtIndex = $counterGetResponsesBatch[$index]; $statusChanged = self::DATA_SENT_TO_MAILCHIMP; if ($hasError === true) { - $count = isset($counterGetResponsesBatchAtIndex[self::DATA_NOT_SENT_TO_MAILCHIMP]) - ? $counterGetResponsesBatchAtIndex[self::DATA_NOT_SENT_TO_MAILCHIMP] + $count = isset($counterGetResponsesBatch[$index][self::DATA_NOT_SENT_TO_MAILCHIMP]) + ? $counterGetResponsesBatch[$index][self::DATA_NOT_SENT_TO_MAILCHIMP] : $increment; $statusChanged = self::DATA_NOT_SENT_TO_MAILCHIMP; } else { - $count = isset($counterGetResponsesBatchAtIndex[self::DATA_SENT_TO_MAILCHIMP]) - ? $counterGetResponsesBatchAtIndex[self::DATA_SENT_TO_MAILCHIMP] + $count = isset($counterGetResponsesBatch[$index][self::DATA_SENT_TO_MAILCHIMP]) + ? $counterGetResponsesBatch[$index][self::DATA_SENT_TO_MAILCHIMP] : $increment; } diff --git a/app/code/community/Ebizmarts/MailChimp/Model/Api/Batches.php b/app/code/community/Ebizmarts/MailChimp/Model/Api/Batches.php index cff1d7168..6d758c68c 100644 --- a/app/code/community/Ebizmarts/MailChimp/Model/Api/Batches.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/Api/Batches.php @@ -267,7 +267,7 @@ public function _getResults( } if ($enabled) { - $helper->logBatchStatus('Get results from Mailchimp'); + $helper->logBatchStatus('Get results from Mailchimp for Magento store '.$magentoStoreId); foreach ($collection as $item) { try { @@ -1169,7 +1169,7 @@ protected function _showResumeEcommerce($batchId, $storeId) $countersSentPerBatch = $helper->getCountersSentPerBatch(); if (!empty($countersSentPerBatch) || $helper->getCountersSentPerBatch() != null) { - $helper->logBatchStatus("Sent batch $batchId for store $storeId"); + $helper->logBatchStatus("Sent batch $batchId for Magento store $storeId"); $helper->logBatchQuantity($helper->getCountersSentPerBatch()); } else { $helper->logBatchStatus("Nothing to sync for store $storeId"); @@ -1187,7 +1187,7 @@ protected function _showResumeSubscriber($batchId, $storeId) $countersSubscribers = $helper->getCountersSubscribers(); if (!empty($countersSubscribers) || $helper->getCountersSubscribers() != null) { - $helper->logBatchStatus("Sent batch $batchId for store $storeId"); + $helper->logBatchStatus("Sent batch $batchId for Magento store $storeId"); $helper->logBatchQuantity($helper->getCountersSubscribers()); } else { $helper->logBatchStatus("Nothing to sync for store $storeId"); diff --git a/app/code/community/Ebizmarts/MailChimp/Model/System/Config/Source/List.php b/app/code/community/Ebizmarts/MailChimp/Model/System/Config/Source/List.php index 7253fb75f..c60f2703f 100644 --- a/app/code/community/Ebizmarts/MailChimp/Model/System/Config/Source/List.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/System/Config/Source/List.php @@ -55,7 +55,7 @@ public function __construct($params) $this->_lists['lists'][0] = $api->getLists()->getLists($listId); } } else { - $this->_lists = $api->getLists()->getLists(null, 'lists', null, 100); + $this->_lists = $api->getLists()->getLists(null, 'lists'); } if (isset($this->_lists['lists']) && count($this->_lists['lists']) == 0) { diff --git a/lib/Ebizmarts/MailChimp/Lists.php b/lib/Ebizmarts/MailChimp/Lists.php index 77166e234..bcd9beeec 100644 --- a/lib/Ebizmarts/MailChimp/Lists.php +++ b/lib/Ebizmarts/MailChimp/Lists.php @@ -122,7 +122,7 @@ public function getLists( $id = null, $fields = null, $excludeFields = null, - $count = null, + $count = 100, $offset = null, $beforeDateCreated = null, $sinceDateCreated = null,