Skip to content

Filter popular categories before applying the result limit - #2950

Open
RabbiIslamRony wants to merge 1 commit into
sovware:developmentfrom
RabbiIslamRony:fix/820-popular-categories-directory-filter
Open

Filter popular categories before applying the result limit#2950
RabbiIslamRony wants to merge 1 commit into
sovware:developmentfrom
RabbiIslamRony:fix/820-popular-categories-directory-filter

Conversation

@RabbiIslamRony

Copy link
Copy Markdown
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

How to reproduce the issue or how to test the changes

  1. Create two directory types and assign more high-count root categories to the second directory than the configured Popular Categories limit.
  2. Assign indexed-only, legacy-only, and dual-key root categories to the first directory, and add an empty category plus a high-count child category.
  3. Open the first directory's search page and confirm the configured number of non-empty root categories is returned in count-descending order, without duplicates or categories from the second directory.
  4. Inspect the term query and confirm directory meta and tt.parent = 0 are applied before the bounded LIMIT clause.

The directory constraint now runs inside the term query before the result limit. It supports the indexed _directory_type_<id> key and the legacy serialized _directory_type key, while preserving root-only, non-empty, count-descending behavior.

Any linked issues

Fixes #820

Checklist

@RabbiIslamRony

Copy link
Copy Markdown
Member Author

The reported PHPCS failure occurs in the inherited pull_request_target workflow before source checkout; the PHPCS step never runs. PR #2945 replaces that unsafe workflow with the fork-safe pull_request workflow. The changed PHP file passes the repository rules locally with zero errors.

@Armanul46 Armanul46 added this to the v8.9.3 milestone Aug 4, 2026
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

Successfully merging this pull request may close these issues.

2 participants