Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
- How do we unpublish a block? A radio button on the BlockContent entity form? a drop button on the BlockContent entity form?
- Permissions? Who can unpublish BlockContent? Who can view unpublished BlockContent?
- Views integration.
- What happens when you unpublish an already placed block?
- Can you place unpublished blocks in a region? But they just don't show up until published.
Comments
Comment #2
timmillwoodComment #3
timmillwoodComment #4
larowlanA checkbox like node provides would be fine, then we could upcast to a dropbutton in the theme - like we do for node forms.
Yeah this will be tricky, we would need to consider it alongside #1975064: Add more granular block content permissions - I think we should follow what node does though.
- should come for free in terms of the field, but we'd need to change the wizard to automatically include the filter.
- we should leave the block placement but the access plugin would return
'#access' => FALSE
on the render array, so it would be essentially hidden.I think yes, that would be a good workflow for deployment/workspaces etc. Publishing the workspace would result in the block being published and the content showing up
Comment #5
timmillwoodJust updated the patch in #2820848: Make BlockContent entities publishable to not render block_content entities in the BlockContent block plugin if the block_content entity is unpublished.
Comment #8
amateescu CreditAttribution: amateescu for Pfizer, Inc. commented#2834546: UI for publishing/unpublishing block_content blocks seems to be handling most of the UI parts, so we need a few other issue for handling permissions and views. I'm changing this into a Plan/discussion issue and marking all the others either as children or simply related.
Comment #9
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedI opened #2905000: Add a default filter on the 'published' field in the base views wizard plugin for publishable entity types for the views part.
Comment #10
Bojhan CreditAttribution: Bojhan as a volunteer and commentedThis should ideally behave the same to nodes, it should disappear from the front-end - but be available and in place in the backend.
I would say yes, this also strongly supports the workflow stages. The bigger question being, can we show items - that are not published, but in other states? Given that the whole point of workflow.
Comment #11
SKAUGHTIMO: a block that is 'un-published' shouldn't just remain as a placed block. then, many unpublished blocks (even as forgotten todo's to re-publish them) could amount in the block UI (or any UI for ordering blocks in a region) with more noise..
In normal Workflow then, publishing a new revision would keep a block placed.
Comment #14
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedI disagree. Publishing and unpublishing blocks could be a handy tool for users, without the "Administer blocks". So they simply enable/disable for example an promotion block, without the fear, that they will break the site. On the other hand. On the other hand: When sites will increasingly use Layout Builder, they would probably use that for placing/removing blocks on a landingpage. It really depends on the use-case, but I think a "Unpublishing the block, but keeping it place for republishing" is quite a valid one.
Comment #23
smustgrave CreditAttribution: smustgrave at Mobomo commentedFrom reading the comments closing this as duplicate of https://www.drupal.org/project/drupal/issues/2834546 which I've been trying to breathe new life into.