Vocabulary Condition provides taxonomy-based visibility conditions for blocks. The conditions plug into the core condition plugin API, so they work on the Block Layout page and anywhere else conditions are available (for example, the Context module).

The 2.0.x branch (the one submitted for review) provides two conditions:

  • Vocabulary or term: applies on taxonomy term pages. It matches whole vocabularies, and additionally specific terms with the option to include all of their descendants.
  • Content tagged with vocabulary: applies on node pages, showing a block on any node tagged with a term from the selected vocabularies or terms, optionally including their descendants.

Vocabularies and terms are combined with OR, and both conditions collect the proper cache metadata so that changes in the term hierarchy invalidate cached results.

How it differs from Drupal core and why it is still useful.

Since Drupal 9.3, core covers the original use case of the 1.x branch (the generic entity bundle condition exposed for taxonomy terms, plus the taxonomy term route context). The 2.x branch goes beyond that: It adds matching by specific term including descendants, which keeps section-based block placement working when new child terms are created, and it adds taxonomy-based visibility for node pages, which core does not provide at all. The 1.x branch is kept only for backwards compatibility and receives no new features.

Project page

https://www.drupal.org/project/vocabulary_condition

Comments

trebormc created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

Thank you for applying!

Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review. See also Policy on the use of AI when contributing to Drupal which is valid when contributing to Drupal, either by committing code in a project, or by creating a merge request for an existing project.

The important notes are the following.

  • For the purposes of this application, it is not necessary to create releases or pre-releases. It is better to make commits only on a branch, and possibly in the same branch used from the start.
  • If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.

    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

avpaderno’s picture

Issue summary: View changes
Status: Needs review » Needs work

What reported in the issue summary about the differences with Drupal core should be added to the project page.

trebormc’s picture

Status: Needs work » Needs review

Thanks for the review. I've updated the project page with a dedicated "How it differs from Drupal core" section.

brian.willows@hsj.co.uk’s picture

Review of vocabulary_condition (2.0.x @ 4607692) — no blockers found; recommend for security advisory coverage.

Small, focused module: taxonomy-based block-visibility conditions for term pages and content pages, adding specific-term and descendant matching over core's entity_bundle condition. I ran the coding-standards tooling and read all three source files plus the tests.

Coding standards: phpcs is fully clean under Drupal + DrupalPractice (0 errors, 0 warnings).

Code quality — good:

  • Idiomatic condition plugins that mirror core's RequestPath pattern (empty-config + isNegated short-circuit); clean dependency injection; term IDs cast to int on submit; summary labels output through t() placeholders (escaped).
  • Correct cacheability: getCacheTags() merges the inspected terms' tags — and, for descendant matching, their ancestors' tags — so hierarchy changes invalidate cached results. This is explicitly covered by a test.
  • Efficient descendant matching: it loads the current term's ancestors and intersects with the selected set, rather than expanding all descendants.
  • Good reuse of core: 2.0.x drops the module's own taxonomy-term ContextProvider now that core taxonomy ships one — less duplicated code.

Tests: kernel coverage for both conditions — discovery, by-vocabulary, by-specific-term, descendants (asserting ancestor cache tags), negation, default config, summary, and a config-schema test. Test code exceeds source in size.

Security: nothing of concern — admin-only block configuration, no raw SQL, entity API throughout, escaped output; visibility-only (not access control).

Checklist: full project; proper 2.0.x branch; clean info.yml (no version/project); core-only dependency (taxonomy); README documents the Node-module requirement of the content condition and the AND-combination caveat.

Optional, non-blocking: (1) no composer.json — fine for a core-only module, but a minimal one is worth adding; (2) the "Content tagged with vocabulary" condition needs the Node module (documented) — you could gate/hide it on node-less sites, but it's harmless as is.

Clean, well-tested, and genuinely differentiated from core. Nice work.

I use Assisted AI but I review what it generates

vishal.kadam’s picture

Priority: Normal » Major

I am changing priority as per Issue priorities.