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.
This does a db_query()/module_invoke_all() as many times as it's requested, could use a static cache.
Comment | File | Size | Author |
---|---|---|---|
#9 | homebox-static-cache-2153629-9.patch | 1.85 KB | mgifford |
#6 | homebox-static-cache-2153629-6.patch | 1.12 KB | mgifford |
#5 | homebox-static-cache-2153629-5.patch | 1.58 KB | mgifford |
#1 | homebox-static-cache-2153629.patch | 949 bytes | catch |
Comments
Comment #1
catchComment #2
catchMain reason to static cache this is that any menu link to a homebox is going to result in this being called.
Comment #3
mgiffordI tested this on simplytest.me. Works as expected.
I didn't do any performance testing, but drupal_static() makes sense to me.
Comment #4
maximpodorov CreditAttribution: maximpodorov commentedThe cache must be cleared after saving homebox page in homebox_save_page().
Comment #5
mgiffordSo like this. Good catch btw.
Comment #6
mgiffordSorry, there was some cruft in that last patch.
Comment #7
maximpodorov CreditAttribution: maximpodorov commentedLooks good and works.
Comment #8
drummhomebox_delete_page()
also needs to clear the cache for the deleted page.In
homebox_get_page():
Setting the cache should also check
is_object($page)
.Comment #9
mgiffordThanks. I believe this addresses your two points.
Comment #11
drummLooks good, committed with a little cleanup.