shopify
shopify copied to clipboard
6.1.1 Products sync error (related to contextual pricing countries)
Description
We updated the Sophify plugin to 6.1.1 and when syncing products from Shopify, we now have this error:
2025-12-10 09:12:08 [web.ERROR] [TypeError] craft\helpers\StringHelper::toUpperCase(): Argument #1 ($str) must be of type string, null given, called in /var/www/website/vendor/craftcms/shopify/src/models/Settings.php on line 244 {"trace":["#0 /var/www/website/vendor/craftcms/shopify/src/models/Settings.php(244): craft\\helpers\\StringHelper::toUpperCase()","#1 /var/www/website/vendor/craftcms/shopify/src/services/Api.php(189): craft\\shopify\\models\\Settings->getContextualPricingCountries()","#2 /var/www/website/vendor/craftcms/shopify/src/services/Products.php(80): craft\\shopify\\services\\Api->getProductGql()","#3 /var/www/website/vendor/craftcms/shopify/src/handlers/Webhook.php(27): craft\\shopify\\services\\Products->syncProductByShopifyId()","#4 /var/www/website/vendor/shopify/shopify-api/src/Webhooks/Registry.php(159): craft\\shopify\\handlers\\Webhook->handle()","#5 /var/www/website/vendor/craftcms/shopify/src/controllers/WebhookController.php(43): Shopify\\Webhooks\\Registry::process()","#6 [internal function]: craft\\shopify\\controllers\\WebhookController->actionHandle()","#7 /var/www/website/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#8 /var/www/website/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()","#9 /var/www/website/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction()","#10 /var/www/website/vendor/craftcms/cms/src/web/Application.php(360): yii\\base\\Module->runAction()","#11 /var/www/website/vendor/craftcms/cms/src/web/Application.php(659): craft\\web\\Application->runAction()","#12 /var/www/website/vendor/craftcms/cms/src/web/Application.php(322): craft\\web\\Application->_processActionRequest()","#13 /var/www/website/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest()","#14 /var/www/website/web/index.php(12): yii\\base\\Application->run()","#15 {main}"],"memory":3445992,"exception":"[object] (TypeError(code: 0): craft\\helpers\\StringHelper::toUpperCase(): Argument #1 ($str) must be of type string, null given, called in /var/www/website/vendor/craftcms/shopify/src/models/Settings.php on line 244 at /var/www/website/vendor/craftcms/cms/src/helpers/StringHelper.php:1775)"}
It seems related to the fact that "Contextual Pricing Countries" is empty in our settings.
Steps to reproduce
- Start a Shopify sync with no value in "Contextual Pricing Countries"
- See a server error
Additional info
- Craft version: 5.8.21
- PHP version: 8.2.28
- Database driver & version: PostgreSQL 16.8
- Plugins & versions: Shopify 6.1.1