Skip to content

Use left outer join instead of include in with_any_category scope#11473

Merged
alecslupu merged 2 commits intodevelopfrom
fix/11467
Sep 14, 2023
Merged

Use left outer join instead of include in with_any_category scope#11473
alecslupu merged 2 commits intodevelopfrom
fix/11467

Conversation

@fblupi
Copy link
Copy Markdown
Member

@fblupi fblupi commented Aug 10, 2023

🎩 What? Why?

Use left_outer_joins instead of includes in with_any_category scope to fix the query when adding an order.

📌 Related Issues

Testing

  1. Go to a participatory space with a proposals component.
  2. Go to the proposals component.
  3. Filter by category.
  4. Order by "most commented" or "most followed" and see it works.

♥️ Thank you!

@fblupi fblupi added module: core type: fix PRs that implement a fix for a bug labels Aug 10, 2023
@fblupi fblupi requested a review from a team August 10, 2023 12:40
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andreslucena
Copy link
Copy Markdown
Member

Not doing the backport to v0.26 as this query wasn't using include on that version: https://github.com/decidim/decidim/blob/release/0.26-stable/decidim-core/lib/decidim/has_category.rb

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

Labels

module: core type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Error ordering proposals after filter them by category

3 participants