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

SQL error when try to view products sorted by Link #59

Closed
lionettiluca opened this issue Nov 25, 2024 · 2 comments
Closed

SQL error when try to view products sorted by Link #59

lionettiluca opened this issue Nov 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@lionettiluca
Copy link

Description

When accessing the "Products" screen and attempting to view the list sorted by the default "Link" order, an SQL error occurs, preventing the data from loading.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'link' in 'order clause' The SQL being executed was: SELECT `elements`.`id`, `elements`.`canonicalId`, `elements`.`fieldLayoutId`, `elements`.`uid`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateLastMerged`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_sites`.`id` AS `siteSettingsId`, `elements_sites`.`siteId`, `elements_sites`.`title`, `elements_sites`.`slug`, `elements_sites`.`uri`, `elements_sites`.`content`, `elements_sites`.`enabled` AS `enabledForSite`, `stripe_products`.`stripeId`, `stripe_productdata`.`stripeStatus`, `stripe_productdata`.`data`, `elements`.`draftId`, `drafts`.`creatorId` AS `draftCreatorId`, `drafts`.`provisional` AS `isProvisionalDraft`, `drafts`.`name` AS `draftName`, `drafts`.`notes` AS `draftNotes` FROM (SELECT `elements`.`id` AS `elementsId`, `elements_sites`.`id` AS `siteSettingsId` FROM `elements` `elements` INNER JOIN `stripe_products` `stripe_products` ON `stripe_products`.`id` = `elements`.`id` INNER JOIN `stripe_productdata` `stripe_productdata` ON `stripe_productdata`.`stripeId` = `stripe_products`.`stripeId` INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`elementId` = `elements`.`id` LEFT JOIN `drafts` `drafts` ON `drafts`.`id` = `elements`.`draftId` WHERE (`elements_sites`.`siteId`=1) AND (`elements`.`archived`=FALSE) AND (`elements`.`dateDeleted` IS NULL) AND (`elements`.`canonicalId` IS NULL) AND ((`elements`.`draftId` IS NULL) OR (`drafts`.`provisional`=FALSE)) AND ((`elements`.`draftId` IS NULL) OR (NOT (`elements`.`canonicalId` IS NULL)) OR (`drafts`.`saved`=TRUE)) AND (`elements`.`revisionId` IS NULL) ORDER BY `link` LIMIT 100) `subquery` INNER JOIN `elements` `elements` ON `elements`.`id` = `subquery`.`elementsId` INNER JOIN `elements_sites` `elements_sites` ON `elements_sites`.`id` = `subquery`.`siteSettingsId` INNER JOIN `stripe_products` `stripe_products` ON `stripe_products`.`id` = `subquery`.`elementsId` INNER JOIN `stripe_productdata` `stripe_productdata` ON `stripe_productdata`.`stripeId` = `stripe_products`.`stripeId` LEFT JOIN `drafts` `drafts` ON `drafts`.`id` = `elements`.`draftId` ORDER BY `link`

Steps to reproduce

  1. Create product type without URI (I've tried with but nothing changed)
  2. Go to admin products list sorted by Link

Additional info

  • Craft version: 5.5.2
  • PHP version: 8.3
  • Database driver & version: MySQL
  • Plugins & versions: Stripe 1.3.0
@lionettiluca lionettiluca added the bug Something isn't working label Nov 25, 2024
@i-just i-just self-assigned this Nov 26, 2024
@i-just
Copy link
Contributor

i-just commented Nov 26, 2024

Hi, thanks for reporting! I raised a PR for this.

@i-just
Copy link
Contributor

i-just commented Nov 28, 2024

Stripe 1.3.1 is out with a fix for that. Thanks again!

@i-just i-just closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants