The code in plugins/context_reaction_block.inc makes a lot of calls to system_region_list. The region list should be cached once.

CommentFileSizeAuthor
#1 context.patch2.69 KBJamesSharpe

Comments

JamesSharpe’s picture

Status: Active » Needs review
StatusFileSize
new2.69 KB

Something like the attached patch to context_reaction_block fixes this. I'm running this on my site and it seems to fix the performance issues.

Mixologic’s picture

This is sortof a dupe of this: https://drupal.org/node/1873450 . but not quite. One fixes it in core, the other fixes it in context.

joelcollinsdc’s picture

FWIW, (i'm the creator of the other issue), I think this should be fixed in context instead of core. (Unless a ton of other modules abuse that function, which I am not aware of...)

tekante’s picture

Status: Needs review » Fixed

Fix applied implemented caching in context reaction block. Used a different pattern than the suggested patch to allow for ease of insertion (and hopefully later removal when #1873450: Caching results of system_region_list lands) and to reduce need for duplicated if var set checks. Thanks for the bug report and suggested patch.

Mixologic’s picture

I looked this over, pulled it in and tested it. Works awesome. #1873450 may never make it into core, but this is likely the only contrib that suffers from it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.