Install

Works with Drupal: ^10.3 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 21.71 KB
MD5: f4a6cd7c2200268aedc0a11aea5d11b3
SHA-1: 702a934eee85a6146db32012ccae6f880ed3e7c9
SHA-256: f12e580f9bff3765b57f1eebe71fce5f0c2967b2801f48cb6b014e23e3ae0e4c
Download zip 31.07 KB
MD5: 0a875f1a46b0972817e53c5e8e3e0911
SHA-1: 43fa832d3706846a92ab246ca552302c532f9569
SHA-256: 86e08b5ed827385a01e277c6dcf4a41b9b41a26acfc838f5bf8a2b8aa505a221

Release notes

First public beta of the Block Content Visibility module. The module is in production use on the maintainer's site and the public API is considered stable for the 1.0.x branch; remaining work for 1.0.0 stable is test coverage, documentation, and adoption feedback.

What's in this release

  • Visibility UI on the block_content form — vertical-tabs group with one tab per available Condition plugin, surfaced via Block Form Alter so the same UI also serves Layout Builder inline blocks.
  • Explicit "Apply this condition" opt-in on every tab. Only conditions the editor explicitly enables get persisted, so default-empty configurations from plugins that mutate their config at submit time (e.g. current_theme) do not leak into storage.
  • Per-instance storage on the block_content entity in a revisionable string_long base field, JSON-encoded. Visibility travels with revisions and Content Moderation states.
  • Render-time evaluation via hook_block_access that mirrors core's BlockAccessControlHandler::checkAccess(): per-condition runtime context resolution, defensive forbid on missing context, and full cache-metadata bubbling. Implicit single-match context auto-wire keeps stored conditions working when their context_mapping is empty.
  • Coexistence with placement-level visibility (logical AND). The placement edit form at /admin/structure/block/manage/<id> displays an inline warning when the underlying block_content has content-level conditions, with a deep-link to edit them. Warning is gated on the new permission.
  • Permission administer block content visibility, hidden by default. Revoking it hides the UI but never disables active rules at render time.
  • Settings form at /admin/config/system/block-content-visibility with two knobs: Enabled block_content bundles (which bundles expose the UI; empty = all) and Hidden Condition plugins (plugins to hide from the form; stored conditions for hidden plugins continue to evaluate).
  • Unit tests covering the Evaluator's entity resolution branches, condition evaluation, exception handling, and the implicit context auto-wire.

Requirements

Installation

composer require drupal/block_content_visibility:^1.0
drush pm:install block_content_visibility

Feedback

Bug reports and feature requests welcome in the issue queue.

Created by: introfini
Created on: 14 May 2026 at 14:31 UTC
Last updated: 14 May 2026 at 14:31 UTC
New features

Other releases