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

Deprecation warning about Order::getAvailableShippingMethods() #1518

Closed
duskosobic opened this issue Jun 18, 2020 · 2 comments
Closed

Deprecation warning about Order::getAvailableShippingMethods() #1518

duskosobic opened this issue Jun 18, 2020 · 2 comments

Comments

@duskosobic
Copy link

Description
Newly installed Craft Commerce Pro trial 3.1.9 plugin generates a deprecation warning: "Order::getAvailableShippingMethods() has been deprecated. Use Order::getAvailableShippingMethodOptions()." at craftcommerce/vendor/yiisoft/yii2/base/ArrayableTrait.php:126

To Reproduce
How, and what happened?

  1. In the CP, go to Commerce > Orders > New Order
  2. Click Cancel button
  3. You will see Deprecation warning in Utilities

Additional info

  • Craft version: Craft Solo 3.4.24
  • PHP version: 7.3.9
  • Database driver & version: MySQL 5.7.26
  • Plugins & versions: Craft Commerce PRO trial 3.1.9

Additional context
Stack Trace:

Steps leading up to the deprecation error:

17 Deprecation error: Order::getAvailableShippingMethods() has been deprecated. Use Order::getAvailableShippingMethodOptions().
Called from /craftcommerce/vendor/craftcms/commerce/src/elements/traits/OrderDeprecatedTrait.php:27
16 craft\commerce\elements\Order::getAvailableShippingMethods()
Called from /craftcommerce/vendor/yiisoft/yii2/base/Component.php:139
15 craft\commerce\elements\Order::__get("availableShippingMethods")
Called from /craftcommerce/vendor/craftcms/cms/src/base/Element.php:1127
14 craft\commerce\elements\Order::__get("availableShippingMethods")
Called from /craftcommerce/vendor/yiisoft/yii2/base/ArrayableTrait.php:126
13 craft\commerce\elements\Order::toArray([0 => "adjustmentSubtotal", 1 => "adjustmentSubtotalAsCurrency", 2 => "adjustmentsTotal", 3 => "adjustmentsTotalAsCurrency", ...], ["lineItems.snapshot", "availableShippingMethods", "billingAddress", "shippingAddress"])
Called from /craftcommerce/vendor/craftcms/commerce/src/controllers/OrdersController.php:410
12 craft\commerce\controllers\OrdersController::_orderToArray(craft\commerce\elements\Order)
Called from /craftcommerce/vendor/craftcms/commerce/src/controllers/OrdersController.php:1041
11 craft\commerce\controllers\OrdersController::_registerJavascript(["order" => craft\commerce\elements\Order, "orderId" => "16", "fieldLayout" => craft\models\FieldLayout, "orderTransactions" => [], ...])
Called from /craftcommerce/vendor/craftcms/commerce/src/controllers/OrdersController.php:157
10 craft\commerce\controllers\OrdersController::actionEditOrder("16", craft\commerce\elements\Order)
9 call_user_func_array([craft\commerce\controllers\OrdersController, "actionEditOrder"], ["16", null])
Called from /craftcommerce/vendor/yiisoft/yii2/base/InlineAction.php:57
8 yii\base\InlineAction::runWithParams(["orderId" => "16", "p" => "admin/commerce/orders/16"])
Called from /craftcommerce/vendor/yiisoft/yii2/base/Controller.php:157
7 craft\commerce\controllers\OrdersController::runAction("edit-order", ["orderId" => "16", "p" => "admin/commerce/orders/16"])
Called from /craftcommerce/vendor/craftcms/cms/src/web/Controller.php:178
6 craft\commerce\controllers\OrdersController::runAction("edit-order", ["orderId" => "16", "p" => "admin/commerce/orders/16"])
Called from /craftcommerce/vendor/yiisoft/yii2/base/Module.php:528
5 craft\web\Application::runAction("commerce/orders/edit-order", ["orderId" => "16", "p" => "admin/commerce/orders/16"])
Called from /craftcommerce/vendor/craftcms/cms/src/web/Application.php:291
4 craft\web\Application::runAction("commerce/orders/edit-order", ["orderId" => "16", "p" => "admin/commerce/orders/16"])
Called from /craftcommerce/vendor/yiisoft/yii2/web/Application.php:103
3 craft\web\Application::handleRequest(craft\web\Request)
Called from /craftcommerce/vendor/craftcms/cms/src/web/Application.php:276
2 craft\web\Application::handleRequest(craft\web\Request)
Called from /craftcommerce/vendor/yiisoft/yii2/base/Application.php:386
1 craft\web\Application::run()
Called from /craftcommerce/web/index.php:22

@duskosobic duskosobic added the New label Jun 18, 2020
@bossanova808
Copy link
Contributor

Yep seeing this too

@nfourtythree
Copy link
Contributor

Hi

Thank you for bringing this to our attention.

We have pushed a fix for this and it will be included in the next release.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants