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

Issue with DateTime on Import #105

Closed
jackabox opened this issue Apr 9, 2024 · 3 comments
Closed

Issue with DateTime on Import #105

jackabox opened this issue Apr 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working Plugins → Shopify For Linear sync Plugins For Linear sync

Comments

@jackabox
Copy link

jackabox commented Apr 9, 2024

Description

Hey, I'm getting a bit of an issue when importing products. They were previously working, but as I'm running the import now they seem to be failing on the datetime stamp. An output of the dump from the console is included below.

Syncing Shopify products…

Exception 'yii\db\Exception' with message 'SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2024-04-08T23:09:43Z' for column 'createdAt' at row 1
The SQL being executed was: INSERT INTO `shopify_productdata` (`shopifyId`, `title`, `bodyHtml`, `createdAt`, `handle`, `images`, `options`, `productType`, `publishedAt`, `publishedScope`, `shopifyStatus`, `tags`, `templateSuffix`, `updatedAt`, `variants`, `vendor`, `metaFields`, `dateCreated`, `dateUpdated`, `uid`) VALUES ('7996473704598', 'Triple Love Oversized Sweatshirt', 'Triple Dotty oversized sweatshirt in a relaxed cosy fit in pink.', '2024-04-08T23:09:43Z', 'triple-love-oversized-sweatshirt', '[{\"id\":35849999876246,\"alt\":null,\"position\":1,\"product_id\":7996473704598,\"created_at\":\"2024-04-08T23:09:43Z\",\"updated_at\":\"2024-04-08T23:09:46Z\",\"admin_graphql_api_id\":\"gid:\\/\\/shopify\\/ProductImage\\/35849999876246\",\"width\":897,\"height\":1024,\"src\":\"https:\\/\\/cdn.shopify.com\\/s\\/files\\/1\\/0639\\/8695\\/8486\\/files\\/abba2b356d66d1ad6e0d5c6f3627d062.jpg?v=1712617786\",\"variant_ids\":[]}]', '[{\"id\":10157142376598,\"product_id\":7996473704598,\"name\":\"Size\",\"position\":1,\"values\":[\"S\\/M (8-10)\",\"L\\/XL (12-14)\"]}]', 'Jumpers', '2024-04-08T23:09:43Z', 'web', 'active', '', '', '2024-04-09T01:08:00Z', '[{\"id\":43369595535510,\"product_id\":7996473704598,\"title\":\"S\\/M (8-10)\",\"price\":\"32.00\",\"sku\":\"\",\"position\":1,\"inventory_policy\":\"deny\",\"compare_at_price\":null,\"fulfillment_service\":\"manual\",\"inventory_management\":\"shopify\",\"option1\":\"S\\/M (8-10)\",\"option2\":null,\"option3\":null,\"created_at\":\"2024-04-08T23:09:45Z\",\"updated_at\":\"2024-04-08T23:11:26Z\",\"taxable\":true,\"barcode\":\"\",\"grams\":0,\"weight\":0,\"weight_unit\":\"lb\",\"inventory_item_id\":45467270971542,\"inventory_quantity\":0,\"old_inventory_quantity\":0,\"requires_shipping\":true,\"admin_graphql_api_id\":\"gid:\\/\\/shopify\\/ProductVariant\\/43369595535510\",\"image_id\":null},{\"id\":43369595568278,\"product_id\":7996473704598,\"title\":\"L\\/XL (12-14)\",\"price\":\"32.00\",\"sku\":\"\",\"position\":2,\"inventory_policy\":\"deny\",\"compare_at_price\":null,\"fulfillment_service\":\"manual\",\"inventory_management\":\"shopify\",\"option1\":\"L\\/XL (12-14)\",\"option2\":null,\"option3\":null,\"created_at\":\"2024-04-08T23:09:45Z\",\"updated_at\":\"2024-04-08T23:11:26Z\",\"taxable\":true,\"barcode\":\"\",\"grams\":0,\"weight\":0,\"weight_unit\":\"lb\",\"inventory_item_id\":45467271004310,\"inventory_quantity\":10,\"old_inventory_quantity\":10,\"requires_shipping\":true,\"admin_graphql_api_id\":\"gid:\\/\\/shopify\\/ProductVariant\\/43369595568278\",\"image_id\":null}]', 'Dotty', '[]', '2024-04-09 15:03:49', '2024-04-09 15:03:49', '6b3a8d2a-6379-47d3-9ea4-0ba35f09a31e')'

Steps to reproduce

  1. Set up craft cms + shopify plugin
  2. Run php craft shopify/sync/products in console.

Additional info

  • Craft version: 5.0.2
  • PHP version: 8.3.3
  • Database driver & version: MySQL 8.3.0
  • Plugins & versions: Shopify 5.0.0
@jackabox jackabox added bug Something isn't working Plugins For Linear sync Plugins → Shopify For Linear sync labels Apr 9, 2024
Copy link

linear bot commented Apr 9, 2024

@nfourtythree nfourtythree self-assigned this Apr 11, 2024
@nfourtythree
Copy link
Contributor

Hi @jackabox

Thank you for raising this issue. Although we weren't directly able to reproduce this issue we have pushed an update that we believe may fix it for you.

This update will be included in the next release of the plugin.

To get this early, change your craftcms/shopify requirement in your project's composer.json to:

"require": {
  "craftcms/shopify": "v4.x-dev#72482b3021362d94a0b7136c088aeb1365389564 as 4.1.1",
  "...": "..."
}

Then run composer update.

Thanks!

@nfourtythree
Copy link
Contributor

This fix is now out in versions 4.1.2 and 5.1.1 of the plugin.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Plugins → Shopify For Linear sync Plugins For Linear sync
Projects
None yet
Development

No branches or pull requests

2 participants