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.

Comments

Ryan Palmer’s picture

Status: Active » Needs review
StatusFileSize
new714 bytes

Patch attached.

Ryan Palmer’s picture

StatusFileSize
new726 bytes

Patched against 7.x-3.x-dev.

hefox’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)

Forgot 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

tekante’s picture

Status: Patch (to be ported) » Fixed

Committed in 7.x-3.x. Thanks for the bug report and the patch. Commit: f6c6d8ae9030fd0503e4ca341b8283feb2389968

Status: Fixed » Closed (fixed)

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