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.
Hi,
don't know if a patch already exists but completly rewrite this function because :
- it could be called very often (specially when using this path). Without static cache, we make a lot of useless queries...
Comment | File | Size | Author |
---|---|---|---|
#4 | homebox-block_access-2043813-3.patch | 1.62 KB | chaby |
#4 | interdiff-2043813-2-3.txt | 474 bytes | chaby |
#2 | homebox-block_access-2043813-2.patch | 1.6 KB | chaby |
#2 | interdiff-2043813-1-2.txt | 1.7 KB | chaby |
#1 | homebox-block_access-2043813-1.patch | 1.72 KB | chaby |
Comments
Comment #1
chaby CreditAttribution: chaby commentedComment #2
chaby CreditAttribution: chaby commentedrewrite it again to cache all blocks set per role types. Like core block module, we hope we won't have a lot of block set per roles.
If you have 10 blocks in a page and don't use ajax, it will make only 1 query instead of 20...
So here is a new patch with a useless interdiff because completly rewrite.
Comment #3
chaby CreditAttribution: chaby commentedComment #4
chaby CreditAttribution: chaby commentedreroll because forgot to init cache
Comment #4.0
chaby CreditAttribution: chaby commentedup
Comment #5
mgiffordI haven't checked the performance improvements, but there would have to be as right now you'd have to call it per block role. I do wonder if it would make sense to use drupal_static() like #2153629: homebox_get_page() should static cache.
Anyways, mostly reporting that the latest patch works and should be an improvement.
Comment #6
drummThere was already a patch for this: #1372406: Cache query results in _homebox_can_view_block() (D7 version). I like that one uses
drupal_static()
and I think might have more code comments.