Problem/Motivation

If multiple subrequests are used, then the last CurrentContext is cached and not re-evaluated.

Proposed resolution

Reset the internal caches of the current context when processing each request.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

e0ipso created an issue. See original summary.

e0ipso’s picture

Status: Active » Needs review
FileSize
1.1 KB

Proposed patch.

  • e0ipso committed bd64a05 on 8.x-1.x
    fix(RequestHandler): Reset the CurrentContext for every processed...
e0ipso’s picture

Status: Needs review » Fixed
dawehner’s picture

An alternative solution could be: Store the actual context keyed by request.

e0ipso’s picture

@dawehner interesting. What would be the benefit of that?

dawehner’s picture

You'd not have to reset, but rather given you have a different active request, it would switch automatically.

\Drupal\Core\Render\Renderer::$contextCollection is using that pattern for example.

Status: Fixed » Closed (fixed)

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