dynamic / silverstripe-shopify

BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

BUG ShopifyImportTask - newly imported products are published, but $owns (images) are not #78

Closed jsirish closed 3 years ago

jsirish commented 3 years ago

Ideally, a new product would not be published on import so things like blocks can be added prior to publishing.

Currently, a newly imported product is published, but the related records such as Images are not. Currently requires a manual publish for the images to show on FE

mak001 commented 3 years ago

I think its caused by https://github.com/dynamic/silverstripe-shopify/blob/5c5da4ef62574025d5b2d8113b36c1dc4bfab9dc/src/Task/ShopifyImportTask.php#L247

The isLiveVersion() call doesn't seem to take into account the related objects as seen in https://github.com/silverstripe/silverstripe-versioned/blob/32b7282cbf5100dc56919698c5cef28c0204fd33/src/Versioned.php#L2792-L2801

removing the isLiveVersion check will fix it, but may come at a slight performance hit

mak001 commented 3 years ago

Should be fixed in #116 which removes versioning from shopify files. They don't have versions in the graphql api.