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.
Posted by xjm
Problem/Motivation
This is a followup issue for #1535868: Convert all blocks into plugins.
- The block architecture currently provides a "disabled" status that allows users to disable blocks so that they are not displayed in the UI.
- Following #1535868: Convert all blocks into plugins, this status becomes a per-instance setting. (Each block can have zero, one, or many configured instances per theme.) There are no disabled block instances on installation; users enable blocks by creating a new instance.
- However, users can disable block instances by moving them to the "disabled" section of the block administrative UI, or by setting their region to "none" on the block instance editing form.
- Users can also delete any block instance following #1535868: Convert all blocks into plugins. This makes the disabled status for blocks less necessary, since a user can remove an unwanted block instance without affecting the block definition.
- The "disable" functionality does not have complete test coverage (the patch in #1535868: Convert all blocks into plugins previously had bugs relating to disabling blocks that did not have test failures).
Proposed resolution
- Decide whether the "disabled" block instance status is still relevant, or whether it is unneeded complexity when users can simply remove block instances.
- Add test coverage for the "disabled" status if it is kept.
- Otherwise, remove it entirely, both from the block plugin and from procedural handling code.
Comments
Comment #1
xjmComment #2
xjmComment #3
jibranI think we should keep block disable status because sometimes content administrator just want to enable/disable the blocks.
Comment #4
xjmThat seems like a reasonable point to me.
Comment #5
benjy CreditAttribution: benjy commentedCan you specify what the bugs were or link to the exact comment, so I don't have to read > 400 comments :)
Comment #6
xjmI did apple+F "disable" on #1535868: Convert all blocks into plugins and found #1535868-352: Convert all blocks into plugins and #1535868-358: Convert all blocks into plugins. But, in general, we should add full test coverage, doing all the things with disabled blocks that you can do through the UI.
Comment #7
jibranTagging for tests.
Comment #7.0
jibranRemoving myself from the author field so that I can unfollow the issue. --xjm
Comment #10
tim.plunkettNot actively part of the Blocks-Layouts work.