Closed (fixed)
Project:
Context
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2011 at 17:09 UTC
Updated:
3 Jan 2012 at 04:50 UTC
Jump to comment: Most recent file
We couldn't figure out why memcache was being hit 11 times by context_condition_map() when a static variable was being used to store this data per page load. What happened was that no items were set to $condition_map by the foreach loop [in this case array_keys(context_conditions()) was empty], and thus the static variable remained empty.
By initializing the array properly, we avoid multiple cache hits.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | context-1056434-2.patch | 726 bytes | Ryan Palmer |
| #1 | context-1056434-1.patch | 714 bytes | Ryan Palmer |
Comments
Comment #1
Ryan Palmer commentedPatch attached.
Comment #2
Ryan Palmer commentedPatched against 7.x-3.x-dev.
Comment #3
hefox commentedForgot to mention your name in commit message, but /did/ remember to git attribute lolz.
http://drupalcode.org/project/context.git/commit/1bda260
Patch applies fine to 7.x and looks fine also
Comment #4
tekante commentedCommitted in 7.x-3.x. Thanks for the bug report and the patch. Commit: f6c6d8ae9030fd0503e4ca341b8283feb2389968