Currently the Block reaction sets a drupal_static variable on the first run, and will only ever evaluate the blocks to be placed on the first run, which is great for performance. The issue is that if another context becomes active due to a condition being evaluated after the initial block plugin run, but before a later block plugin run, then the additional context block reactions never come into play.

While it is arguable that this timing issue shouldn't exist, but there are cases were some blocks are rendered at one time, and others at a later time, and I can attest that this issue does exist on a site I am actively working on.

A simple enough solution is to hash the serialized representation of the active contexts array and include that hash in the drupal_static variable name, so in the case this issue does come up it will get the new blocks.

Patch incoming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deciphered created an issue. See original summary.

Deciphered’s picture