ethercreative / mailchimp-commerce

Mailchimp integration with Craft Commerce
Other
5 stars 11 forks source link

Sync Products: Verbb Events translation issue #17

Closed timeverts closed 4 years ago

timeverts commented 5 years ago

Events from the Verbb Events plugin are registered as a custom MailChimp Product by your plugin. However, I wasn't seeing them showing up as an option to Sync in the Products section on the Sync tab.

So I investigated further and determined the following exception was being thrown when MailChimp E-Commerce attempts to register Events as a custom product type:

yii\base\InvalidConfigException#1
(
    [*:message] => 'Unable to locate message source for category \'events\'.'
    [Exception:string] => ''
    [*:code] => 0
    [*:file] => '.../vendor/yiisoft/yii2/i18n/I18N.php'
    [*:line] => 201
    [Exception:trace] => [
        0 => [
            'file' => '.../vendor/yiisoft/yii2/i18n/I18N.php'
            'line' => 89
            'function' => 'getMessageSource'
            'class' => 'yii\\i18n\\I18N'
            'type' => '->'
            'args' => [
                0 => 'events'
            ]
        ]
        1 => [
            'file' => '.../vendor/craftcms/cms/src/i18n/I18N.php'
            'line' => 327
            'function' => 'translate'
            'class' => 'yii\\i18n\\I18N'
            'type' => '->'
            'args' => [
                0 => 'events'
                1 => 'Events'
                2 => []
                3 => 'en-AU'
            ]
        ]
        2 => [
            'file' => '.../vendor/yiisoft/yii2/BaseYii.php'
            'line' => 526
            'function' => 'translate'
            'class' => 'craft\\i18n\\I18N'
            'type' => '->'
            'args' => [
                0 => 'events'
                1 => 'Events'
                2 => []
                3 => 'en-AU'
            ]
        ]
        3 => [
            'file' => '.../vendor/ether/mailchimp-commerce/src/services/ChimpService.php'
            'line' => 113
            'function' => 't'
            'class' => 'yii\\BaseYii'
            'type' => '::'
            'args' => [
                0 => 'events'
                1 => 'Events'
            ]
        ]
        4 => [
            'file' => '.../vendor/ether/mailchimp-commerce/src/MailchimpCommerce.php'
            'line' => 112
            'function' => 'getProducts'
            'class' => 'ether\\mc\\services\\ChimpService'
            'type' => '->'
            'args' => []
        ]
        5 => [
            'file' => '.../vendor/yiisoft/yii2/base/BaseObject.php'
            'line' => 109
            'function' => 'init'
            'class' => 'ether\\mc\\MailchimpCommerce'
            'type' => '->'
            'args' => []
        ]
        6 => [
            'file' => '.../vendor/yiisoft/yii2/base/Module.php'
            'line' => 158
            'function' => '__construct'
            'class' => 'yii\\base\\BaseObject'
            'type' => '->'
            'args' => [
                0 => [
                    'name' => 'Mailchimp Commerce'
                    'version' => '1.1.10'
                    'schemaVersion' => '1.0.2'
                    'description' => 'Mailchimp integration with Craft Commerce'
                    'developer' => 'Ether'
                    'developerUrl' => 'https://ethercreative.co.uk'
                    'documentationUrl' => 'https://github.com/ethercreative/mailchimp-commerce/blob/master/README.md'
                    'packageName' => 'ether/mailchimp-commerce'
                    'isInstalled' => true
                    'edition' => 'standard'
                    'settings' => [
                        'disableSyncing' => false
                        'apiKey' => 'XXXXX'
                        'storeId' => 'XXXXX'
                        'listId' => '1deaf7b5a6'
                        'optInField' => null
                        'shippedStatusHandle' => 'shipped'
                        'thumbnailTransform' => null
                        'imageTransform' => null
                        'promoRedemptionUrl' => null
                        'abandonedCartRestoreUrl' => null
                        'expiredCartError' => 'Your cart has expired!'
                        'completedCartError' => 'You\'ve already completed this order!'
                        'cartRestoredNotice' => 'Your cart has been restored!'
                    ]
                ]
            ]
        ]
        ...

Seems like somehow the translation category 'events' is not bootstrapped yet by Craft.

In case it's important, my Craft 3 site is using the 'en-au' locale. I tested changing it to the 'en' locale, but that did not resolve the issue.

I'm running latest Craft 3, with latest Commerce and Events plugin.

Hopefully you can reproduce this.

alexjcollins commented 5 years ago

Thanks for the info here, we'll get back to you as soon as we can.