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.
block_page_alter() queries for both hidden and all regions on every page, but only needs to know about hidden regions on the block admin page.
Comment | File | Size | Author |
---|---|---|---|
#9 | block.patch | 1.53 KB | catch |
block.patch | 1.21 KB | catch | |
Comments
Comment #1
figaro CreditAttribution: figaro commentedDoes the following code actually do anything in your if-statement?:
$visible_regions = system_region_list($theme, REGIONS_VISIBLE)
Comment #2
catchNope, but the alternative would be a nested if I think, not keen on either.
Comment #3
figaro CreditAttribution: figaro commentedThat's my point. If you swap it with
isset($visible_regions[$region])
it might just be a tad faster for when the other two conditions fail.Comment #4
catchThat's not possible though, since we need to set $visible_regions in order to do an isset() against it.
Comment #5
figaro CreditAttribution: figaro commentedI understand your approach now, thanks
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedlooks good. this got introduced during some toolbar madness.
Comment #7
catchI'm going to set this back to RTBC, since I don't think it got committed.
Comment #8
Dries CreditAttribution: Dries commentedI think it is slightly cleaner to split that if-test. Can you do a quick re-roll?
Comment #9
catchHere it is with the nested if.
Comment #10
moshe weitzman CreditAttribution: moshe weitzman commentedComment #11
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.