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 error for Craft CMS fields with handle `order` #4134

Open
Anubarak opened this Issue Apr 12, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@Anubarak
Copy link
Contributor

Anubarak commented Apr 12, 2019

Description

I have a Craft CMS field with the handle order and I always receive a deprecation error because of this

The “order” element query param has been deprecated. Use “orderBy” instead.

The given stack trace looks like the following

27 | Deprecation error: The “order” element query param has been deprecated. Use “orderBy” instead. Called from /var/www/myspa/htdocs/vendor/craftcms/cms/src/elements/db/ElementQuery.php:402

26 | craft\elements\db\AssetQuery::__get("order") Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/base/ArrayableTrait.php:126

25 | craft\elements\db\AssetQuery::toArray() Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/helpers/BaseJson.php:157

24 | yii\helpers\BaseJson::processData(craft\elements\db\AssetQuery, [], "5cb088450119f2.57190485") Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/helpers/BaseJson.php:176

23 | yii\helpers\BaseJson::processData(["id" => "494", "typeId" => "1", "taxCategoryId" => "1", "shippingCategoryId" => "1", ...], [], "5cb088450119f2.57190485")
Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/helpers/BaseJson.php:61

22 | yii\helpers\BaseJson::encode(["id" => "494", "typeId" => "1", "taxCategoryId" => "1", "shippingCategoryId" => "1", ...]) Called from /var/www/myspa/htdocs/vendor/craftcms/cms/src/helpers/Db.php:127

21 | craft\helpers\Db::prepareValueForDb(["id" => "494", "typeId" => "1", "taxCategoryId" => "1", "shippingCategoryId" => "1", ...]) Called from /var/www/myspa/htdocs/vendor/craftcms/cms/src/db/ActiveRecord.php:42

20 | craft\commerce\records\LineItem::prepareForDb() Called from /var/www/myspa/htdocs/vendor/craftcms/cms/src/db/ActiveRecord.php:32

19 | craft\commerce\records\LineItem::beforeSave(false) Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/db/BaseActiveRecord.php:794

18 | craft\commerce\records\LineItem::updateInternal(null) Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/db/ActiveRecord.php:676

17 | craft\commerce\records\LineItem::update(false, null) Called from /var/www/myspa/htdocs/vendor/yiisoft/yii2/db/BaseActiveRecord.php:681

16 | craft\commerce\records\LineItem::save(false) Called from /var/www/myspa/htdocs/vendor/craftcms/commerce/src/services/LineItems.php:211

15 | craft\commerce\services\LineItems::saveLineItem(craft\commerce\models\LineItem, false) Called from /var/www/myspa/htdocs/vendor/craftcms/commerce/src/elements/Order.php:2123

14 | craft\commerce\elements\Order::_saveLineItems() Called from /var/www/myspa/htdocs/vendor/craftcms/commerce/src/elements/Order.php:967

13 | craft\services\Elements::saveElement(craft\commerce\elements\Order, false) Called from /var/www/myspa/htdocs/modules/myspa/controllers/BookingController.php:789

Maybe this belongs to the Commerce Plugin since it's a little bit more related to this but I decided to post it here because the warning is created in the Craft CMS repo.
No first world problem at all, just wanted to inform you

@Anubarak Anubarak changed the title Deprecation error for Craft cms fields with handle `order` Deprecation error for Craft CMS fields with handle `order` Apr 12, 2019

@brandonkelly

This comment has been minimized.

Copy link
Member

brandonkelly commented Apr 16, 2019

@lukeholder why is an element query getting included in LineItem record data?

@lukeholder

This comment has been minimized.

Copy link
Member

lukeholder commented Apr 16, 2019

@brandonkelly do you mean the order being added to the extraFields?: craftcms/commerce@a880bea#diff-95df435f4aafb29ba3c6f6677aa982deR228

@lukeholder

This comment has been minimized.

Copy link
Member

lukeholder commented Apr 16, 2019

@Anubarak Just to confirm, where did you add the order field? to the Product or the Variant?

@Anubarak

This comment has been minimized.

Copy link
Contributor Author

Anubarak commented Apr 16, 2019

None of both. Sorry I should have clarified it from the beginning. This field belongs to a totally different layout and is only used in a separate section that links to an order (the channel is some kind of feedback channel for orders to rate the service)

Neither the orders nor the lineitems or variants are related to those in any way and I'm totally sure I don't use the deprecated order function instead of orderBy in my code.

The message is there for about 5 months and I thought if it was a common/known issue it would have been fixed by the time + it's no first world problem so didn't contact you earlier.

To be honest I don't even know where the AssetQuery comes from because there is no assets field in the order/variant either. My purchasable has an assets field if that helps but as said the volume doesn't have the said order field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.