Skip to content

Restrict the branch filter to validated revisions - #442

Open
ECYaz wants to merge 1 commit into
phpbb:3.3.xfrom
ECYaz:fix/379-branch-filter-validated
Open

Restrict the branch filter to validated revisions#442
ECYaz wants to merge 1 commit into
phpbb:3.3.xfrom
ECYaz:fix/379-branch-filter-validated

Conversation

@ECYaz

@ECYaz ECYaz commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #379

The only revision_validated check sat inside the permission clause, which moderators skip and authors bypass, so denied revisions still matched the branch filter.

The branch condition itself now requires a validated revision, using the same semantics as the version list on the same page (gated on require_validation, validation-free types exempt), and the redundant check in the permission clause is removed.

The category and index contribution listings matched a contribution
against the branch filter whenever any revision row existed for that
branch, regardless of the revision's validation state. The only
revision_validated check sat inside the permission clause, where it is
skipped for moderators and bypassed by the author and view-authorised
OR-branches, so a style whose only 3.3 revision had been denied still
appeared under the 3.3.x filter with a 3.2 version badge.

Build the validated requirement into the branch condition itself, using
the same semantics as the version list rendered on the very same page:
gated on require_validation, with the validation-free types exempt.
The now redundant check in the permission clause is removed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the branch filter logic so contributions only match a selected phpBB branch when they have an eligible (validated) revision for that branch, preventing denied/pulled revisions from causing false matches. It aligns the branch filter’s validation semantics with the existing “version list” logic on the same page (respecting require_validation and exempting validation-free contribution types).

Changes:

  • Introduces a centralized $branch_filter clause that enforces branch matching and (when configured) validated revisions.
  • Applies $branch_filter to the main listing queries (category/all/featured flows) instead of in a downstream permission-gating clause.
  • Removes the redundant rp.revision_validated = 1 check from the permissions WHERE augmentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Branches filter is included unapproved or denied revisions

3 participants