Skip to content

Add category intersections to File Entries (#5415) - #5416

Open
TomJaeger wants to merge 1 commit into
7.devfrom
fix/file-category-and-filter
Open

TomJaeger wants to merge 1 commit into
7.devfrom
fix/file-category-and-filter

Conversation

@TomJaeger

Copy link
Copy Markdown
Contributor

File Entries currently treats category="8&24" as one category ID, so it cannot require files to belong to both categories.

Add a grouped category-membership subquery to support & intersections, including not intersections. Existing pipe filters and the surrounding file filters and pagination retain their current paths. The production change adds 14 lines of query logic.

Resolves #5415

Validation:

  • Focused File module PHPUnit suite passes on PHP 7.4 and 8.5: 15 tests, 26 assertions each.
  • Tests exercise the production query builder against in-memory SQLite fixtures, including category combinations, exclusions, other filters, and distinct pagination.
  • PHP syntax checks and git diff --check pass; independent review found no actionable issues.
  • Live MySQL execution and performance remain unverified; the full suite was not validated.

Negated intersections follow logical set exclusion: if one requested category has no assignments, no file matches the complete intersection, so eligible files remain included. This differs from Channel Entries' existing early-return behavior for that edge case.

@TomJaeger TomJaeger added enhancement New feature or request needs documentation labels Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

& in category parameter of the Files module does not limit returned entries to only those that are assigned to 2 or more categories.

1 participant