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

$siteSettings variable used as object incorrectly in ProductTypes #645

Closed
ccchapman opened this issue Jan 22, 2019 · 0 comments
Closed

$siteSettings variable used as object incorrectly in ProductTypes #645

ccchapman opened this issue Jan 22, 2019 · 0 comments

Comments

@ccchapman
Copy link

Description

In the ProductTypes class, on line 484, $siteSettings is used as an object.

This variable appears to be an array in this context.

if ($siteSettingsRecord->isAttributeChanged('hasUrls', false) && !$siteSettings->hasUrls) {

yii\base\ErrorException: Trying to get property 'hasUrls' of non-object in /home/vagrant/craftcms/vendor/craftcms/commerce/src/services/ProductTypes.php:484
Stack trace:
#0 /home/vagrant/craftcms/vendor/craftcms/cms/src/services/ProjectConfig.php(815): craft\commerce\services\ProductTypes->handleChangedProductType()
#1 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/Component.php(627): craft\services\ProjectConfig->craft\services\{closure}()
#2 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/Component.php(627): ::call_user_func:{/home/vagrant/craftcms/vendor/yiisoft/yii2/base/Component.php:627}()
#3 /home/vagrant/craftcms/vendor/craftcms/cms/src/services/ProjectConfig.php(517): craft\services\ProjectConfig->trigger()
#4 /home/vagrant/craftcms/vendor/craftcms/cms/src/services/ProjectConfig.php(364): craft\services\ProjectConfig->processConfigChanges()
#5 /home/vagrant/craftcms/vendor/craftcms/commerce/src/services/ProductTypes.php(368): craft\services\ProjectConfig->set()
#6 /home/vagrant/craftcms/vendor/craftcms/commerce/src/controllers/ProductTypesController.php(158): craft\commerce\services\ProductTypes->saveProductType()
#7 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/InlineAction.php(57): craft\commerce\controllers\ProductTypesController->actionSaveProductType()
#8 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/home/vagrant/craftcms/vendor/yiisoft/yii2/base/InlineAction.php:57}()
#9 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()
#10 /home/vagrant/craftcms/vendor/craftcms/cms/src/web/Controller.php(109): craft\commerce\controllers\ProductTypesController->runAction()
#11 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/Module.php(528): craft\commerce\controllers\ProductTypesController->runAction()
#12 /home/vagrant/craftcms/vendor/craftcms/cms/src/web/Application.php(297): craft\web\Application->runAction()
#13 /home/vagrant/craftcms/vendor/craftcms/cms/src/web/Application.php(561): craft\web\Application->runAction()
#14 /home/vagrant/craftcms/vendor/craftcms/cms/src/web/Application.php(281): craft\web\Application->_processActionRequest()
#15 /home/vagrant/craftcms/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#16 /home/vagrant/craftcms/web/index.php(21): craft\web\Application->run()
#17 {main}

Steps to reproduce

  1. Create a new product type, leaving the URI format stock
  2. Revisit the product type and make the URI format empty
  3. Receive error exception shown above

Additional info

  • Craft version: 3.1.3
  • Craft Commerce: 2.0.1
  • PHP version: 7.2.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant