Needs work
Project:
Context
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Feb 2014 at 20:47 UTC
Updated:
19 Nov 2018 at 23:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jrbeemanSorry - realized this is inaccurate.
Comment #2
mikeytown2 commentedIf using panels_mini, this can save around 10ms per block removed. Also caching the query helps by another 20ms.
Patch also fixes some minor white space issues.
Comment #3
mikeytown2 commentedComment #4
mikeytown2 commentedComment #5
mikeytown2 commentedComment #6
mikeytown2 commentedComment #7
sgdev commentedAny movement on this patch? We've been using it successfully on a site for a while.
I'd mark as RTBC, but would be good to have others give their feedback.
Comment #8
mikeytown2 commentedWell you know I've been using it as well. There's not a lot of followers on this issue so go ahead and make it RTBC.
Comment #9
sgdev commentedDone, thanks...
Comment #10
hass commentedCan you add tests for this?
Aside, why is the result cached unaltered? I'm not sure if this is best practice...
Comment #11
mikeytown2 commentedMy reasoning was that the alter might do something based off of some external context (like user, url, theme, etc). Currently doing a search in Gotta Download Them All via
grep -rn -e "_context_block_info_alter(" ./to see if I can find any use cases where this is true.Looking over it and the hook gets implemented in 3 places; most complex is inside of the i18n_block module.
defaultcontent.module - defaultcontent_context_block_info_alter(&$blocks)
i18n_block.module - i18n_block_context_block_info_alter(&$block_info)
blocks_mass_cache.module - blocks_mass_cache_context_block_info_alter(&$blocks)
I'm not 100% sure caching the alter would be safe due the the usage of theme_default; see http://drupal.stackexchange.com/questions/161300/page-caching-wrong-css for an example of this being dynamic.
Comment #12
mikeytown2 commentedOpps wrong hook
http://cgit.drupalcode.org/context/tree/plugins/context_reaction_block.i...
Looking at these 2
Nothing implements hook_context_block_list_alter but there's a lot of modules that implement hook_block_list_alter. This alter can not be cached.
Also noted that the theme is appart of the cid for this cache so the previous alter would have been ok; issue is hook_block_list_alter is used everywhere, pulling in external context that we can never know about, thus making it uncacheable.
Comment #13
mikeytown2 commentedSo a test case would be to make sure that hook_context_block_list_alter only gets blocks for the given region and not all of the blocks. Is there any coverage for get_blocks currently?
Comment #14
hass commentedNo idea. I'm new to this module and just fixed a bunch of menu issues. I'd only like to prevent failures in future.
Comment #15
glynster commented+ RTBC makes a big difference for us.
Comment #16
nedjoSetting to needs work.