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.
I created a menu named Header with machine name of header. When I placed the block into a region of the same name (header), the region is no longer listed in the UI. The block does get placed, and the block's region dropdown shows being set to Header. Screenshot attached of block UI. Deleting the block causes the Header region to show in the UI again.
Steps to reproduce:
- Create a block with machine name of "header" ( Menus and Custom blocks both produce the behavior)
- Place block in Block UI, adding it to "header" region
Expected Behavior:
Block is placed and shows in "header" region in UI.
What happened instead:
Block gets placed in header region, but header region disappears from Block UI.
Beta phase evaluation
Issue category | Bug because the UI can break under certain circumstances |
---|---|
Issue priority | Normal because the UI is still functional and it doesn't affect runtime |
Disruption | Not disruptive because no real changes. |
Comment | File | Size | Author |
---|---|---|---|
#10 | 2508547-block-10.patch | 2.34 KB | tim.plunkett |
#7 | interdiff.txt | 303 bytes | tim.plunkett |
#7 | 2508547-block-7.patch | 21.31 KB | tim.plunkett |
#4 | Block layout | Drupal-2015-06-23.png | 73.74 KB | tim.plunkett |
Screen Shot 2015-06-18 at 1.16.29 PM.png | 98.91 KB | tannerjfco |
Comments
Comment #1
tim.plunkettI was able to reproduce. Taking a look into this.
Comment #2
tim.plunkettStill needs tests. I had to refactor a bit to track down the bug.
Comment #3
tim.plunkettHere's a test.
Comment #4
tim.plunkettAlso note, it not only removes the region name, it incorrectly puts the faulty block into that section of the page.
Comment #6
tim.plunkettThe title makes this sound like a MUCH bigger problem, hah.
Comment #7
tim.plunketthook_rebuild() doesn't return anything.
Postponed #2513534: Remove the 'disabled' region from Block UI on this bug fix, since it refactors the block UI code.
Comment #8
tim.plunkettComment #9
neclimdulLots of good refactoring. Tried really hard to find a mistake in it but the one I thought I found in block_rebuild even turned out to just be cleanup.
The fix. Prefixing the form element so it doesn't collide.
Comment #10
tim.plunkettOkay I got called out for the scope creep. Opening another issue to do the refactoring.
Also we lost the test coverage somewhere.
Comment #11
tim.plunkettMoved the refactor to #2514998: Reduce fragility in the monolithic BlockListBuilder
Comment #12
neclimdulback to rtbc
Comment #13
jibranRTBC +1
Comment #14
Wim LeersWhat an amazing bug btw! :D
Comment #16
xjmThis is delightful. Bumped to major as someone who encountered this on a site would have no clue what was going on.
I manually tested to double-check that the change to the form structure is not linked into block entity configuration (in order to confirm that there is no data model change and no update path needed).
This issue is a major bug fix, and the only disruption is in changing the array structure of the block form, so it is allowed per https://www.drupal.org/core/beta-changes.