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 if the order is saved through console command in 2.1.7 version #42

Closed
ivarsbariss-solspace opened this issue Nov 8, 2021 · 1 comment · Fixed by #43
Closed

Comments

@ivarsbariss-solspace
Copy link

ivarsbariss-solspace commented Nov 8, 2021

Hi,

We updated the plugin to 2.1.7 version and when order is saved through a console command the Avatax plugin causes this error Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Request::getParam()' in /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Component.php:301

Stack trace:

Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Request::getParam()'
in /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Component.php:301
Stack trace:
#0 /home/forge/solspace.magna-power.com/vendor/surprisehighway/craft-avatax/src/services/SalesTaxService.php(787): yii\base\Component->__call()
#1 /home/forge/solspace.magna-power.com/vendor/surprisehighway/craft-avatax/src/services/SalesTaxService.php(106): surprisehighway\avatax\services\SalesTaxService->parseOverrideParam()
#2 /home/forge/solspace.magna-power.com/vendor/surprisehighway/craft-avatax/src/adjusters/AvataxTaxAdjuster.php(24): surprisehighway\avatax\services\SalesTaxService->createSalesOrder()
#3 /home/forge/solspace.magna-power.com/vendor/craftcms/commerce/src/elements/Order.php(1828): surprisehighway\avatax\adjusters\AvataxTaxAdjuster->adjust()
#4 /home/forge/solspace.magna-power.com/plugins/magnapowerbusinessfunctions/src/MagnaPowerBusinessFunctions.php(210): craft\commerce\elements\Order->recalculate()
#5 [internal function]: solspace\magnapowerbusinessfunctions\MagnaPowerBusinessFunctions->solspace\magnapowerbusinessfunctions{closure}()
#6 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#7 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Component.php(637): yii\base\Event::trigger()
#8 /home/forge/solspace.magna-power.com/vendor/craftcms/cms/src/base/Element.php(4102): yii\base\Component->trigger()
#9 /home/forge/solspace.magna-power.com/vendor/craftcms/commerce/src/elements/Order.php(2071): craft\base\Element->afterSave()
#10 /home/forge/solspace.magna-power.com/vendor/craftcms/cms/src/services/Elements.php(2687): craft\commerce\elements\Order->afterSave()
#11 /home/forge/solspace.magna-power.com/vendor/craftcms/cms/src/services/Elements.php(783): craft\services\Elements->_saveElementInternal()
#12 /home/forge/solspace.magna-power.com/plugins/magnapowerbusinessfunctions/src/services/Data.php(589): craft\services\Elements->saveElement()
#13 /home/forge/solspace.magna-power.com/plugins/magnapowerbusinessfunctions/src/services/Data.php(478): solspace\magnapowerbusinessfunctions\services\Data->processOrderFile()
#14 /home/forge/solspace.magna-power.com/plugins/magnapowerbusinessfunctions/src/console/controllers/DataController.php(56): solspace\magnapowerbusinessfunctions\services\Data->processInbox()
#15 [internal function]: solspace\magnapowerbusinessfunctions\console\controllers\DataController->actionProcessInbox()
#16 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#17 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams()
#18 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction()
#19 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction()
#20 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction()
#21 /home/forge/solspace.magna-power.com/vendor/craftcms/cms/src/console/Application.php(89): yii\console\Application->runAction()
#22 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/console/Application.php(148): craft\console\Application->runAction()
#23 /home/forge/solspace.magna-power.com/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest()
#24 /home/forge/solspace.magna-power.com/craft(22): yii\base\Application->run()
#25 {main}

It seems like that with 2.1.7 a bug was introduced for a console environment where the Avatax plugin tries to call a getParam() from a request which isn't possible for the console environment.

@imagehat
Copy link
Collaborator

imagehat commented Nov 8, 2021

@ivarsbariss-solspace - thanks for catching this. I just bumped the version to 2.1.8 with a fix.

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

Successfully merging a pull request may close this issue.

2 participants