Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect DATETIME value #1261

Open
sprankhub opened this issue Nov 25, 2021 · 1 comment
Open

Incorrect DATETIME value #1261

sprankhub opened this issue Nov 25, 2021 · 1 comment

Comments

@sprankhub
Copy link
Contributor

Preconditions

  1. Magento 1.9.4.5
  2. Ebizmarts_MailChimp 1.1.22
  3. PHP 7.3
  4. MySQL 8

Steps to reproduce

  1. Not sure, just looked into the log.

Expected result

  1. No errors in MailChimp_Errors.log.

Actual result

  1. The following error is logged:

     2021-11-25T12:47:36+00:00 DEBUG (7): SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: '', query was: SELECT `main_table`.* FROM `newsletter_subscriber` AS `main_table` WHERE (`subscriber_status` = 1) AND (main_table.store_id = 0) AND ((`mailchimp_sync_delta` IS NULL) OR (`mailchimp_sync_delta` = '') OR (`mailchimp_sync_delta` \< '2019-09-06 07:39:53') OR (`mailchimp_sync_modified` = 1)) AND (`mailchimp_sync_error` = '') LIMIT 200
    
@henryhayes
Copy link

henryhayes commented Nov 6, 2023

Quick fix:

app\code\community\Ebizmarts\MailChimp\Model\Api\Subscribers.php


        $collection = Mage::getResourceModel('newsletter/subscriber_collection')
            ->addFieldToFilter('subscriber_status', array('eq' => 1))
            ->addFieldToFilter('store_id', array('eq' => $this->getStoreId()))
            ->addFieldToFilter(
                array(
                    'mailchimp_sync_delta',
                    //'mailchimp_sync_delta',
                    'mailchimp_sync_delta',
                    'mailchimp_sync_modified'
                ),
                array(
                    array('null' => true),
                    //array('eq' => ''),
                    array('lt' => $helper->getSubMinSyncDateFlag($this->getStoreId())),
                    array('eq' => 1)
                )
            );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants