fix(access-control): complete gate access-rule option lists (NPPD-2135) - #772
Open
Conversation
#772) The gate editor's Paid Access pickers could not offer every value a gate may legitimately hold. Institutions were fetched at a fixed page size of 100, so a site with more than that could not select the rest. Subscription options came from `wc_get_products()`, which returns parent products only, so a gate holding a variation ID had no matching option to render or re-select. Fetch institutions unbounded in both pickers and in the institutions list screen, and list a variable subscription's variations alongside their parent. The variations are read from their post rows rather than hydrated as products: the generated title and attribute summary are both on the row, and this runs on every admin load that localises the access rules. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rCzfAdU78NbYcPqXRrNKQ
adekbadek
force-pushed
the
nppd-2135-access-rule-option-lists-are-truncated-institutions-cap-at
branch
from
July 30, 2026 12:42
05a1a92 to
4705a4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
The gate editor's Paid Access pickers could not offer every value a gate may legitimately hold.
Institutions were fetched at a fixed page size of 100, so a site with more than that could not select the rest — in either picker, or on the Institutions list screen, where the surplus was not even editable. Both now fetch unbounded.
Subscription options listed parent products only, so a gate holding a variation ID had no matching option to render or re-select. Woo Memberships–migrated data carries those IDs, and the rule already honours them. Variations are now listed alongside their parent, so a gate can require one tier without requiring the others.
Institution options stay published-only: an unpublished institution is never evaluated, so offering one would build a rule that silently does nothing.
Closes NPPD-2135.
Stacked on #756 — targets its branch, not
main. #756 rewrites the same picker lines.How to test the changes in this Pull Request:
NEWSPACK_CONTENT_GATES. Activate WooCommerce and WooCommerce Subscriptions.<name> (#<id>). Before this change only the parents appeared.Other information:
Verified on an isolated env with 120 institutions and a variable subscription;
OK (2366 tests, 6698 assertions), PHPCS clean.Follow-up filed while working on this: NPPD-2143 — the institutional rule fails open when a site has no institutions, because the picker degrades to free text and a string value grants access to everyone. Pre-existing; not addressed here.