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.
On the blocks administration page is an ‘Enabled’ column with a checkbox to enable the block. Additionally, we have a ‘Region’ column which defines the region. But if a block is not enabled, it doesn’t and shouldn’t have a region assigned. This patch removes the ‘Enabled’ column and adds a
Comment | File | Size | Author |
---|---|---|---|
#8 | block.module_19.patch | 3.55 KB | kkaefer |
#7 | block.module_18.patch | 3.35 KB | RobRoy |
block-enabled.patch | 3.33 KB | kkaefer | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedgreat idea ... block admin with multiple themes is quite tricky so we should test this patch in that scenario. of course, i have a feeling that scenario behaves unexpectedly with or without this patch.
Comment #2
RobRoy CreditAttribution: RobRoy commentedTested this out. Works well. A very nice improvement. +1
There's still some work to be done with block administration and this is a step forward.
Comment #3
RobRoy CreditAttribution: RobRoy commentedChanged title.
Cross referencing http://drupal.org/node/92630
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedRobRoy - if possible, mark this as RTBC or say what more is needed.
Comment #5
RobRoy CreditAttribution: RobRoy commentedOkay, marking this RTBC. I gave it a +1 in my first comment above and the patch is still great. Shortly I will submit a patch in the issue I referenced in #3 to add the region drop down to the block add/edit page as well.
Comment #6
RobRoy CreditAttribution: RobRoy commentedI'm modifying this patch so that we use a new constant BLOCK_REGION_NONE instead of just -1, but I had one question: On line 324 I was going to write a comment for why we are using !== instead of != (like core is doing for all ==='s). Why are we using a !== instead of != there?
Comment #7
RobRoy CreditAttribution: RobRoy commentedAlso, is the (int) on 289 necessary since we are passing that through %d which would ensure that a boolean is converted to an integer value? Just want to make this clean.
Here is a change with ONLY the addition of the constant. Still think maybe we should change !== to != and remove the (int). Thoughts?
Comment #8
kkaefer CreditAttribution: kkaefer commentedRobRoy is right. We don't need (int) and !==.
Comment #9
profix898 CreditAttribution: profix898 commentedCode looks good and works as expected.
Really nice improvement :)
Comment #10
Dries CreditAttribution: Dries commentedI like. Good job. Committed.
Comment #11
(not verified) CreditAttribution: commented