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

Sortable Custom Fields #993

Closed
stenvdb opened this issue Sep 2, 2019 · 2 comments
Closed

Sortable Custom Fields #993

stenvdb opened this issue Sep 2, 2019 · 2 comments

Comments

@stenvdb
Copy link

stenvdb commented Sep 2, 2019

Since Craft 3.2 allows for sortable custom fields, I kind of expect this feature to work for products & orders as well. Is this on the roadmap to implement?

@lukeholder
Copy link
Member

This has been fixed for the next commerce 2 release.

@stenvdb
Copy link
Author

stenvdb commented Sep 16, 2019

Just installed the new commerce version, getting errors when trying to sort a relational entries field in the products overview.

{"error":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field:8' in 'order clause'\nThe SQL being executed was: SELECT `elements`.`id`, `elements`.`fieldLayoutId`, `elements`.`uid`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_sites`.`slug`, `elements_sites`.`siteId`, `elements_sites`.`enabled` AS `enabledForSite`, `elements_sites`.`uri`, `commerce_products`.`id`, `commerce_products`.`typeId`, `commerce_products`.`promotable`, `commerce_products`.`freeShipping`, `commerce_products`.`postDate`, `commerce_products`.`expiryDate`, `commerce_products`.`defaultPrice`, `commerce_products`.`defaultVariantId`, `commerce_products`.`defaultSku`, `commerce_products`.`defaultWeight`, `commerce_products`.`defaultLength`, `commerce_products`.`defaultWidth`, `commerce_products`.`defaultHeight`, `commerce_products`.`taxCategoryId`, `commerce_products`.`shippingCategoryId`, `commerce_products`.`availableForPurchase`, `content`.`id` AS `contentId`, `content`.`title`, `content`.`field_accountLoginTitle`, `content`.`field_accountRegisterInfo`, `content`.`field_accountRegisterTitle`, `content`.`field_deleteAccount`, `content`.`field_deleteAccountConfirm`, `content`.`field_address`, `content`.`field_articleText`, `content`.`field_articleTitle`, `content`.`field_message`, `content`.`field_description`, `content`.`field_width`, `content`.`field_ctaLinkTop`, `content`.`field_ctaLinkBottomLeft`, `content`.`field_ctaLinkBottomRight`, `content`.`field_email`, `content`.`field_footerPaymentMethodsTitle`, `content`.`field_footerContactList`, `content`.`field_footerContactTitle`, `content`.`field_footerAboutList`, `content`.`field_footerAboutTitle`, `content`.`field_footerShopList`, `content`.`field_footerShopTitle`, `content`.`field_noAddressesText`, `content`.`field_noResultsBody`, `content`.`field_noResultsTitle`, `content`.`field_relatedProductsTitle`, `content`.`field_HexColor`, `content`.`field_body`, `content`.`field_introText`, `content`.`field_introTitle`, `content`.`field_smallDescription`, `content`.`field_shortSentence`, `content`.`field_shoppingCartEmpty`, `content`.`field_linkUrl`, `content`.`field_createAccount`, `content`.`field_createAccountInfo`, `content`.`field_sizeClothing`, `content`.`field_sizeKnitwear`, `content`.`field_mailGeneralSignature`, `content`.`field_mailGeneralIssueLink`, `content`.`field_mailOrder`, `content`.`field_mailContactUser`, `content`.`field_mailVerifyEmail`, `content`.`field_mailActivationUser`, `content`.`field_mailVerifyUser`, `content`.`field_mailForgotPassword`, `content`.`field_fabric`, `content`.`field_fabricDescription`, `content`.`field_modelDescription`, `content`.`field_newsletterIntro`, `content`.`field_fitting`, `content`.`field_recaptchaScore`, `content`.`field_recaptchaScoreThreshold`, `content`.`field_recaptchaSecretKey`, `content`.`field_recaptchaSiteKey`, `content`.`field_shoeSize`, `content`.`field_seoSettings`, `content`.`field_serviceBannerBody`, `content`.`field_serviceBannerSubtitle`, `content`.`field_serviceBannerTitle`, `content`.`field_sticky`, `content`.`field_phone`, `content`.`field_testTranslator`, `content`.`field_title1`, `content`.`field_showInFooter`, `content`.`field_showInNav`, `content`.`field_shippingCostsInfo`, `content`.`field_fullName`, `content`.`field_washingInstructions`\nFROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `elementsSitesId`, `content`.`id` AS `contentId`\nFROM `craft_elements` `elements`\nINNER JOIN `craft_commerce_products` `commerce_products` ON `commerce_products`.`id` = `elements`.`id`\nINNER JOIN `craft_elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id`\nINNER JOIN `craft_content` `content` ON (`content`.`elementId` = `elements`.`id`) AND (`content`.`siteId` = `elements_sites`.`siteId`)\nWHERE (`commerce_products`.`typeId` IN ('1', '2', '3', '4')) AND (`commerce_products`.`typeId` IN ('1', '2', '3', '4')) AND (`elements_sites`.`siteId`='1') AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`draftId` IS NULL) AND (`elements`.`revisionId` IS NULL)\nORDER BY `field:8`\nLIMIT 50) `subquery`\nINNER JOIN `craft_commerce_products` `commerce_products` ON `commerce_products`.`id` = `subquery`.`elementsId`\nINNER JOIN `craft_elements` `elements` ON `elements`.`id` = `subquery`.`elementsId`\nINNER JOIN `craft_elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`elementsSitesId`\nINNER JOIN `craft_content` `content` ON `content`.`id` = `subquery`.`contentId`\nORDER BY `field:8`"}

Something I can share to help you find the issue?

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

2 participants