Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292917

Make block context faster

$
0
0

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

Remaining tasks

User interface changes

API changes


Viewing all articles
Browse latest Browse all 292917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>