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

Error when trying to view orders by status in CP #550

Closed
johnnyhawley opened this issue Nov 1, 2018 · 7 comments
Closed

Error when trying to view orders by status in CP #550

johnnyhawley opened this issue Nov 1, 2018 · 7 comments
Assignees

Comments

@johnnyhawley
Copy link

Description

Getting an error notification when trying to view orders by status in CP.

From web.log:
yii\base\UnknownPropertyException: Setting unknown property: craft\commerce\elements\db\OrderQuery::orderStatus

Steps to reproduce

  1. View orders by status in CP

Additional info

  • Craft version: 3.0.29
  • PHP version: 7.2
  • Database driver & version:
  • Plugins & versions:
    Commerce 2.0.0-beta.13
    Stripe for Craft Commerce 1.0.8
@gjhead
Copy link

gjhead commented Nov 1, 2018

I'm seeing the same. Viewing any orders by Order Status results in a big red "An Unknown Error Occurred."

Steps to reproduce

View orders by status in CP

Additional info

Craft version: Craft Pro 3.0.29
PHP version: 7.2,1
Database driver & version: MySQL 5.6.38

Plugins & versions:
Commerce 2.0.0-beta.13

@brandonkelly brandonkelly self-assigned this Nov 2, 2018
@brandonkelly
Copy link
Member

Not able to reproduce this. Can one of you please search your storage/logs/web.log file for orderStatus and paste in the full error log including the stack trace?

@gjhead
Copy link

gjhead commented Nov 2, 2018

There is a lot to in these logs, but hopefully this is what you are looking for:

2018-11-01 17:14:51 [-][1][v67ju5m8muffjiuif2fbnmbko8][error][yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Setting unknown property: craft\commerce\elements\db\OrderQuery::orderStatus in /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/Component.php:209
Stack trace:
#0 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/cms/src/elements/db/ElementQuery.php(425): yii\base\Component->__set('orderStatus', Object(craft\commerce\models\OrderStatus))
#1 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/commerce/src/elements/db/OrderQuery.php(139): craft\elements\db\ElementQuery->__set('orderStatus', Object(craft\commerce\models\OrderStatus))
#2 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/BaseYii.php(546): craft\commerce\elements\db\OrderQuery->__set('orderStatus', Object(craft\commerce\models\OrderStatus))
#3 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(299): yii\BaseYii::configure(Object(craft\commerce\elements\db\OrderQuery), Array)
#4 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(85): craft\controllers\ElementIndexesController->_elementQuery()
#5 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\controllers\ElementIndexesController->init()
#6 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/Controller.php(86): yii\base\BaseObject->__construct(Array)
#7 [internal function]: yii\base\Controller->__construct('element-indexes', Object(craft\web\Application), Array)
#8 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/di/Container.php(375): ReflectionClass->newInstanceArgs(Array)
#9 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\controlle...', Array, Array)
#10 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/BaseYii.php(345): yii\di\Container->get('craft\\controlle...', Array)
#11 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/Module.php(642): yii\BaseYii::createObject('craft\\controlle...', Array)
#12 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/Module.php(596): yii\base\Module->createControllerByID('element-indexes')
#13 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/Module.php(522): yii\base\Module->createController('get-elements')
#14 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/cms/src/web/Application.php(282): yii\base\Module->runAction('element-indexes...', Array)
#15 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/cms/src/web/Application.php(542): craft\web\Application->runAction('element-indexes...', Array)
#16 /Users/gjhead/Sites/primanti-stage/vendor/craftcms/cms/src/web/Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#17 /Users/gjhead/Sites/primanti-stage/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 /Users/gjhead/Sites/primanti-stage/web/index.php(21): yii\base\Application->run()
#19 {main}

@johnnyhawley
Copy link
Author

johnnyhawley commented Nov 2, 2018

2018-11-02 14:08:40 [-][1][dr2akpea7ihsg29osp8scdeidb][info][yii\db\Command::query] SELECT `id`, `name`, `handle`, `color`, `sortOrder`, `default`
FROM `commerce_orderstatuses`
ORDER BY `sortOrder`
2018-11-02 14:08:40 [-][1][dr2akpea7ihsg29osp8scdeidb][profile begin][yii\db\Command::query] SELECT `id`, `name`, `handle`, `color`, `sortOrder`, `default`
FROM `commerce_orderstatuses`
ORDER BY `sortOrder`
2018-11-02 14:08:40 [-][1][dr2akpea7ihsg29osp8scdeidb][profile end][yii\db\Command::query] SELECT `id`, `name`, `handle`, `color`, `sortOrder`, `default`
FROM `commerce_orderstatuses`
ORDER BY `sortOrder`
2018-11-02 14:08:40 [-][1][dr2akpea7ihsg29osp8scdeidb][error][yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Setting unknown property: craft\commerce\elements\db\OrderQuery::orderStatus in /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/Component.php:209
Stack trace:
#0 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/cms/src/elements/db/ElementQuery.php(425): yii\base\Component->__set('orderStatus', Object(craft\commerce\models\OrderStatus))
#1 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/commerce/src/elements/db/OrderQuery.php(139): craft\elements\db\ElementQuery->__set('orderStatus', Object(craft\commerce\models\OrderStatus))
#2 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/BaseYii.php(546): craft\commerce\elements\db\OrderQuery->__set('orderStatus', Object(craft\commerce\models\OrderStatus))
#3 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(299): yii\BaseYii::configure(Object(craft\commerce\elements\db\OrderQuery), Array)
#4 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(85): craft\controllers\ElementIndexesController->_elementQuery()
#5 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\controllers\ElementIndexesController->init()
#6 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/Controller.php(86): yii\base\BaseObject->__construct(Array)
#7 [internal function]: yii\base\Controller->__construct('element-indexes', Object(craft\web\Application), Array)
#8 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/di/Container.php(375): ReflectionClass->newInstanceArgs(Array)
#9 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\controlle...', Array, Array)
#10 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/BaseYii.php(345): yii\di\Container->get('craft\\controlle...', Array)
#11 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/Module.php(642): yii\BaseYii::createObject('craft\\controlle...', Array)
#12 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/Module.php(596): yii\base\Module->createControllerByID('element-indexes')
#13 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/Module.php(522): yii\base\Module->createController('get-elements')
#14 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/cms/src/web/Application.php(282): yii\base\Module->runAction('element-indexes...', Array)
#15 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/cms/src/web/Application.php(542): craft\web\Application->runAction('element-indexes...', Array)
#16 /home/vagrant/web/primalgourmetsc.com/vendor/craftcms/cms/src/web/Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#17 /home/vagrant/web/primalgourmetsc.com/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 /home/vagrant/web/primalgourmetsc.com/web/index.php(42): yii\base\Application->run()
#19 {main}
2018-11-02 14:08:40 [-][1][dr2akpea7ihsg29osp8scdeidb][info][application] $_GET = []

$_POST = [
    'context' => 'index'
    'elementType' => 'craft\\commerce\\elements\\Order'
    'source' => 'orderStatus:new'
    'criteria' => [
        'status' => ''
        'siteId' => '1'
        'search' => ''
        'limit' => '50'
        'enabledForSite' => ''
    ]
    'viewState' => [
        'mode' => 'table'
        'sort' => 'desc'
        'order' => 'dateOrdered'
    ]
]

@23d1
Copy link

23d1 commented Nov 2, 2018

I can confirm, also having this issue. Viewing "All Orders" works, but any time clicking a status gives a double-error (Unknown Error Occurred).

Not sure if this is related in any way, but getting deprecation warning as well;

craft\commerce\elements\db\OrderQuery::updatedBefore is deprecated. Use dateUpdated() instead.

The stack trace shows that it's in the internal workings of Commerce, not templating.

/craft/vendor/craftcms/commerce/src/elements/db/OrderQuery.php:136

@brandonkelly
Copy link
Member

Thanks everyone. We just released 2.0.0-beta.13.1 with a fix for this.

@gjhead
Copy link

gjhead commented Nov 2, 2018

Thanks for looking into this so quickly, @brandonkelly !

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

4 participants