- 🇳🇱Netherlands basvredeling Amsterdam
This patch works well but would be more in line with the current Drupal block visibility conditions if it were stated as radio buttons saying "Show for..." / "Hide for..." like we do on the path / pages block condition.
- 🇱🇹Lithuania eugis
@basvredeling, this works for my cases (just ignore the MissingValueContextException if the condition is negated).
- 🇺🇸United States wmcmillian-coalmarch
Re-rolled #15 ✨ Add support for negating node type(content type) condition for block visibility Needs work for 10.2.1 and incorporated #20 ✨ Add support for negating node type(content type) condition for block visibility Needs work
- last update
10 months ago 25,754 pass, 1,846 fail - last update
10 months ago Build Successful - last update
10 months ago Build Successful - 🇺🇸United States dswier
I am working on an upgrade from 9.5 to 10.2, and previously we had been using the patch in #8 that now doesn't apply. Trying out #21, we discovered that blocks we had been using this negate condition on were showing up again where they shouldn't be. I am not familiar enough with core code to understand what patch #20 is doing, but I found that reverting just those changes brought back the behavior we were expecting. I'm attaching a patch without those changes. If the code in #20 is still necessary, I'd be glad to help with any changes, but first I would need some help understanding what it is supposed to be doing.
- last update
7 months ago Patch Failed to Apply - 🇺🇸United States sonfd Portland, ME
Really just reiterating notes made in #11.
In my testing with patch #22, i.e. if we just remove
entity_bundle:node
from the$disable_negation
array, it works as expected for nodes, but it adds a secret restriction of also only limiting the block to nodes.For example, if I have a block and the only visibility rules I apply are to:
- Select Content type: Page
- Select "Negate the condition"
This removes the page title block from my Page nodes, however it also removes the page title block from any non-node page. I suspect this may be why this is not allowed without a patch here.
I thought maybe I could add an additional condition, to show on Pages matching
/*
, but it seems that it does not - it still does not show on non-node pages, e.g. user login or view pages. - 🇺🇸United States sonfd Portland, ME
I think this is related? blocked by? https://www.drupal.org/project/drupal/issues/2823432 🐛 Node Type / Entity bundle conditions evaluation is wrong when context is not provided Needs work
- 🇺🇸United States sonfd Portland, ME
Also noting that the Block Visibility Conditions → module provides a specific "Not Content Type" filter that works as expected.