Skip to content

Commit

Permalink
Fix empty filters errors for Resend Ecommerce Data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Sep 30, 2019
1 parent f19b057 commit 5950285
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions app/code/community/Ebizmarts/MailChimp/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,9 @@ public function getDateSyncFinishByMailChimpStoreId($mailchimpStoreId)
}

/**
* Set the values to send all the items again.
*
* @param $scopeId
* @param $scope
* @param $scopeId
* @param $scope
* @param null $filters
* @throws Mage_Core_Exception
*/
public function resendMCEcommerceData($scopeId, $scope, $filters = null)
Expand All @@ -858,7 +857,7 @@ public function resendMCEcommerceData($scopeId, $scope, $filters = null)
$this->removeEcommerceSyncData($scopeId, $scope, false, $filters);
$this->clearErrorGrid($scopeId, $scope, true, $filters);

if (in_array('PRO', $filters)) {
if ($filters !== null && in_array(Ebizmarts_MailChimp_Model_Config::IS_PRODUCT, $filters)) {
$this->deleteFlushMagentoCacheFlag();
}
}
Expand All @@ -868,9 +867,10 @@ public function resendMCEcommerceData($scopeId, $scope, $filters = null)
* Remove items from mailchimp_ecommerce_sync_data table to allow them to be sent.
* If scopeId is 0 remova from all scopes.
*
* @param $scopeId
* @param $scope
* @param bool $deleteErrorsOnly
* @param $scopeId
* @param $scope
* @param bool $deleteErrorsOnly
* @param null $filters
* @throws Mage_Core_Exception
*/
public function removeEcommerceSyncData($scopeId, $scope, $deleteErrorsOnly = false, $filters = null)
Expand All @@ -884,7 +884,7 @@ public function removeEcommerceSyncData($scopeId, $scope, $deleteErrorsOnly = fa
}

/**
* @throws Mage_Core_Exception
* @param null $filters
*/
public function removeAllEcommerceSyncDataErrors($filters = null)
{
Expand All @@ -907,8 +907,8 @@ public function removeAllEcommerceSyncDataErrors($filters = null)

/**
* @param $mailchimpStoreId
* @param bool $deleteErrorsOnly
* @throws Mage_Core_Exception
* @param bool $deleteErrorsOnly
* @param null $filters
*/
public function removeEcommerceSyncDataByMCStore($mailchimpStoreId, $deleteErrorsOnly = false, $filters = null)
{
Expand Down Expand Up @@ -1122,9 +1122,10 @@ public function resetErrors($scopeId, $scope = 'stores')
* Clear mailchimp_errors grid for given scope.
* Exclude subscriber if flag set to true.
*
* @param $scopeId
* @param $scope
* @param bool $excludeSubscribers
* @param $scopeId
* @param $scope
* @param bool $excludeSubscribers
* @param null $filters
* @throws Mage_Core_Exception
*/
public function clearErrorGrid($scopeId, $scope, $excludeSubscribers = false, $filters = null)
Expand All @@ -1142,6 +1143,7 @@ public function clearErrorGrid($scopeId, $scope, $excludeSubscribers = false, $f

/**
* @param $mailchimpStoreId
* @param null $filters
*/
public function clearErrorGridByMCStore($mailchimpStoreId, $filters = null)
{
Expand All @@ -1160,6 +1162,7 @@ public function clearErrorGridByMCStore($mailchimpStoreId, $filters = null)

/**
* @param $scopeId
* @param null $filters
*/
public function clearErrorGridByStoreId($scopeId, $filters = null)
{
Expand Down Expand Up @@ -1200,14 +1203,15 @@ public function handleOldErrors()
/**
* @param $scopeId
* @param $scope
* @param null $filters
* @throws Mage_Core_Exception
*/
public function saveLastItemsSent($scopeId, $scope, $filters = null)
{
$mailchimpStoreId = $this->getMCStoreId($scopeId, $scope);
$isSyncing = $this->getMCIsSyncing($mailchimpStoreId, $scopeId, $scope);

if ($isSyncing != 1) {
if ($isSyncing != 1 && $filters !== null) {
$configValues = array();

if ($this->getCustomerResendLastId($scopeId, $scope) === null
Expand Down

0 comments on commit 5950285

Please sign in to comment.