Problem/Motivation
During the usage of the webprofiler on a stock Drupal (no content needed etc., just standard install) I realized that the following events needed not 0 time as I would have expected it: 'block.condition_context'
What is this event doing. For every block in the system we try to figure out the context of this block. There are by default three subscribers for determining the context of a block:
NodeRouteContext
CurrentUserContext
CurrentLanguageContext
None of them actually differ from block to block, they are all "global" contexts.
Proposed resolution
- Determine the context object just once for each of these services
- Clone the context object before setting it into the block