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

After install and Setup Backend is not working #88

Closed
WitchcraftSolutions opened this issue Nov 22, 2023 · 5 comments
Closed

After install and Setup Backend is not working #88

WitchcraftSolutions opened this issue Nov 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@WitchcraftSolutions
Copy link

  1. Installed it and set it all up with the standart Shopify URL
  2. Then Set up a Custom Domain for the Store
  3. Then changed the shopify hostname to the new URL
  4. and then as soon i try to log in to my Craft backend i get the error below.

I tried Uninstall , Reinstall but as soon i Enter the Credentials and hit save i get this.

Additional info

TypeError: Cannot assign null to property Shopify\Auth\Session::$shop of type string in /home/witchcraftsolutions.com/dev/vendor/shopify/shopify-api/src/Auth/Session.php:32
Stack trace:
#0 /home/witchcraftsolutions.com/dev/vendor/craftcms/shopify/src/services/Api.php(211): Shopify\Auth\Session->__construct()
#1 /home/witchcraftsolutions.com/dev/vendor/craftcms/shopify/src/Plugin.php(248): craft\shopify\services\Api->getSession()
#2 [internal function]: craft\shopify\Plugin->craft\shopify{closure}()
#3 /home/witchcraftsolutions.com/dev/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#4 /home/witchcraftsolutions.com/dev/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger()
#5 /home/witchcraftsolutions.com/dev/vendor/craftcms/cms/src/web/UrlManager.php(346): yii\base\Component->trigger()
#6 /home/witchcraftsolutions.com/dev/vendor/craftcms/cms/src/web/UrlManager.php(115): craft\web\UrlManager->_getRules()
#7 /home/witchcraftsolutions.com/dev/vendor/craftcms/cms/src/web/Request.php(1349): craft\web\UrlManager->parseRequest()
#8 /home/witchcraftsolutions.com/dev/vendor/yiisoft/yii2/web/Application.php(82): craft\web\Request->resolve()
#9 /home/witchcraftsolutions.com/dev/vendor/craftcms/cms/src/web/Application.php(290): yii\web\Application->handleRequest()
#10 /home/witchcraftsolutions.com/dev/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()
#11 /home/witchcraftsolutions.com/dev/web/index.php(12): yii\base\Application->run()
#12 {main}

@WitchcraftSolutions WitchcraftSolutions added the bug Something isn't working label Nov 22, 2023
@lukeholder
Copy link
Member

If this issue persisted, please send a support ticket to [email protected] with

  • Steps to reproduce
  • A database dump
  • All logs

we can then take a look at this issue that seems to be specific to your installation. Thanks.

@benjaminkohl
Copy link

I am receiving this exact same exception that prevents access to the entire control panel. In my case, I was setting the plugin settings to use environment variables, clicked "Save" and then saw this exception. Then tried navigating to other pages in the control panel and I see this exception thrown on any CP URL.

Craft 5.1.3
Shopify Plugin 5.1.1

@benjaminkohl
Copy link

After review, it appears the Utils::sanitizeShopDomain() method in the Shopify library has a second parameter for custom domains and it looks like the plugin is only passing a single $shop parameter.

https://github.com/Shopify/shopify-api-php/blob/main/src/Utils.php#L32

@ryanmasuga
Copy link

We have two hybrid Craft / Shopify projects riding on whether this will work for us or not, but we cannot test because it prevents access to the CP when installed. Can this ticket be reopened? Or is it better to email support?

@benjaminkohl
Copy link

For anyone that finds this issue, I posted a new issue at the repo for the underlying shopify PHP package. It was that package's Auth/Session class calling the sanitization method without the using the custom domain parameter.

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

No branches or pull requests

4 participants