Problem/Motivation
When multiple features are selected in the Feature Toggle block visibility
condition, the condition evaluates to TRUE if any of the selected
features is enabled (OR logic). However, the form title "When the following
features are enabled" implies that all selected features must be
enabled (AND logic). There is no way to configure AND behaviour, making it
impossible to gate a block on multiple features simultaneously.
Steps to reproduce
- Create two feature toggles:
feature_aandfeature_b. - Enable only
feature_a. - Configure a block visibility condition using Feature Toggle, selecting both
feature_aandfeature_b. - The block is visible, even though
feature_bis disabled.
Proposed resolution
Add an explicit OR / AND operator option to the condition form. The operator
defaults to OR, preserving full backward compatibility with existing
configurations. When AND is selected, the condition only evaluates to TRUE
when all selected features are enabled.
The form labels are also updated for clarity: the operator field is presented
as "Show this block when…" with plain-language option labels, and the feature
list description is simplified to "Leave all unchecked to always show."
Remaining tasks
None.
User interface changes
The block visibility condition form gains a new "Show this block when" radio
field (OR / AND) rendered above the feature checkboxes. Existing configurations
are unaffected — they default to OR on save.

API changes
None.
Data model changes
The condition plugin configuration gains a new operator key
('OR' or 'AND'). Existing stored configurations
without this key fall back to 'OR' via a null-coalesce guard,
requiring no migration.
| Comment | File | Size | Author |
|---|---|---|---|
| screenshot.jpg | 137.74 KB | tregismoreira |
Issue fork feature_toggle-3592634
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tregismoreira commented