Remove node visibility condition code from block settings form

Created on 2 March 2017, over 7 years ago
Updated 15 September 2023, about 1 year ago

I found that node type visibility condition, used in block settings, is added twice in Drupal core. One is provided by the node module (node type condition plugin at core/modules/node/src/Plugin/Condition/NodeType.php). The other is at the block settings form (core/modules/block/src/BlockForm.php, line 259).

The second one always overrides the first. The node type condition visibility adds a "negate" option lost by the (accidentally?) overriding.

Basic patch attached for that, but other parts of the core block module might be affected or revised.

πŸ› Bug report
Status

Closed: works as designed

Version

9.4

Component
BlockΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ͺπŸ‡ΈSpain manuel.adan 🌌

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium bramvandenbulcke

    I have a website with a block where content type + negate this condition was used. The checkbox 'negate this condition' is no longer shown but the negate is still applied. So, I'm basically locked out of the setting. The website uses Chaos Tools.

    I'm also in favour of this setting. In my case I have a hero region which applies for all content types except some secondary layouts. So in that case I use negate: if another content type is added, it would also have the hero region. Using negate is often a way to make an install easier to manage in the future.

Production build 0.71.5 2024