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.
Main page content block is required but there is a way to disable it:
1. change "Main page content" block to -Select- (move to Disabled)
2. Save it
Comment | File | Size | Author |
---|---|---|---|
#26 | drupal_1380858_26.patch | 4.16 KB | Xano |
#19 | main_content_block_required-19.patch | 4.17 KB | grisendo |
#19 | main_content_block_required-19.only-test.must-fail.patch | 3.33 KB | grisendo |
#19 | main_content_block_required-14_19.interdiff.txt | 2.46 KB | grisendo |
#14 | main_content_block_required-14.patch | 4.18 KB | grisendo |
Comments
Comment #1
catchThere's another issue for this somewhere, however I can't find it now. Either way this is just a normal bug, not major.
Comment #2
iSampo CreditAttribution: iSampo commentedThe patch provided works as it should.
Sidenote:
What about the sites that want to take full control of the blocks using the Context module?
Should they be able to disable the main content block from the block admin page?
Usually I disable all of the blocks when building the site (when this bug still existed) and then create a global Context that puts the main content in its place. But now that I tried to disable the main content block with this bug (and without Context), the content seems to always stay in the content area (which is really good if you don't have an admin theme and you'd disable your main content block). I think this is how it's supposed to work?
Sorry for getting maybe a bit off-rails here.
Comment #3
droplet CreditAttribution: droplet commented@iSampo,
no functional changes in above patch. Try to create a thread in Context issue page and see what the maintainer said :)
Comment #4
ivander CreditAttribution: ivander commentedmain_content_block_required.patch queued for re-testing.
Comment #5
jantoine CreditAttribution: jantoine commentedI think #687686: Prevent hiding the Content Block on particular pages is the duplicate issue catch was referring too.
Comment #6
droplet CreditAttribution: droplet commentedIt seems like different issue to me. #687686 force to show Content block at frontend? and this one fixing bug at backend.
#687686,
This issue is fixing this. At least can't disable it through UI
Comment #7
valthebaldwhere this assumption comes from?
Comment #8
benjy CreditAttribution: benjy commentedThe validation should now be moved into BlockListController.
Comment #9
grisendo CreditAttribution: grisendo commentedRe-rolled
Comment #11
grisendo CreditAttribution: grisendo commentedBlock naming changed a bit in that form, so I made changes reflected on interdiff.
Also, changed error message to make it more clear.
Comment #12
benjy CreditAttribution: benjy commentedShould this be "Main page content block..."
Other than that, looks ready to go.
Comment #13
grisendo CreditAttribution: grisendo commentedText changed
Comment #14
grisendo CreditAttribution: grisendo commentedAttached new patch with tests added.
Comment #16
grisendo CreditAttribution: grisendo commented14: main_content_block_required-14.patch queued for re-testing.
Comment #17
grisendo CreditAttribution: grisendo commentedGreen!
Comment #18
benjy CreditAttribution: benjy commented"needs to be assigned to a region."
Should be: "placed in a region"
should be "Try to set main page content block in the content region."
no capital on "Content"
Sorry, some nitpicking text remarks!
Comment #19
grisendo CreditAttribution: grisendo commentedChanged
Comment #21
grisendo CreditAttribution: grisendo commentedTest completed
Comment #22
benjy CreditAttribution: benjy commentedLooks good to me.
Comment #23
Xano19: main_content_block_required-19.patch queued for re-testing.
Comment #24
Xano19: main_content_block_required-19.patch queued for re-testing.
Comment #26
XanoRe-roll.
Comment #28
Xano26: drupal_1380858_26.patch queued for re-testing.
Comment #29
benjy CreditAttribution: benjy commentedWas previously RTBC so setting back.
Comment #30
xjm26: drupal_1380858_26.patch queued for re-testing.
Comment #32
benjy CreditAttribution: benjy commentedThis should at least be:
\Drupal::service('form_builder')->setErrorByName()
And we should probably inject the form_builder service.
Comment #41
quietone CreditAttribution: quietone as a volunteer commentedThis needs an issue summary update. In particular, what is the proposed resolution?
And an updated patch for 9.3.x
Comment #42
quietone CreditAttribution: quietone as a volunteer commentedForgot to add tag.
Comment #43
pameeela CreditAttribution: pameeela commentedI know that usually the newer issue should be closed as a duplicate, but in this case #2546590: Main content block shows up on page, even if hidden has much more, and much more recent, activity so I'm going to close this one to prevent possibly working on two different approaches. I will move credit there for contributors to this issue.