This is a followup to #1535868: Convert all blocks into plugins.
Block visibility settings need to be revisited in the context of the Display model.
With respect to determining whether or not a particular user sees a block, the plan is to have two independent considerations:
- Visibility, which is attached to the Display containing a block instance, but the block instance itself knows nothing about.
- Access, which is inseparably implemented on the Block class itself as a method.
Most, if not all, of what's currently done with block visibility should fall into the former category.
Comments
Comment #1
sdboyer commentedComment #2
xjmComment #3
webchickThis is not "normal" :)
Comment #4
gábor hojtsyTesting blocks as plugins now, visibility settings do work (at least for paths), so I assume this would be implementing them in some new context where they are displayed, but is not yet applicable as-is. What else is this postponed on?
Comment #5
gábor hojtsyAlso there are currently JS bugs related to visibility, see #1882252: Regression: Block visibility summaries are broken (quick fix proposal posted there).
Comment #6
xjmComment #7
jibranCan we add per entity type + bundle visibility and remove node type visibility?
Comment #8
xjmThat sounds like a brand new feature to me, so I don't think so at this point. It's also out of scope for this issue I think.
Comment #9
tim.plunkettI would think this is still blocked on #1896076: Contextual Plugins and supporting code and whatever Display SCOTCH code @sdboyer is working on.
Because right now, we still have working visibility, the same as D7.
Comment #10
jibran#1896076-71: Contextual Plugins and supporting code is committed.
Comment #11
jibranAs per #8 I have created #1932810: Add entity bundles condition plugin for entities with bundles.
Comment #12
xjmI'm thinking this might be D9 material now, unless there is a compelling reason to break APIs by refactoring here?
I thought there was some feature regression from D7 related to block visibility, but #9 seems to indicate otherwise.
Comment #13
xjm#1871854: Decide whether to restore per-user block visibility or provide it in contrib was the feature regression I was thinking of, so moving this to 9.x.
Comment #14
catch#2278541: Refactor block visibility to use condition plugins.