Change record status: 
Introduced in branch: 
2.3.x
Introduced in version: 
2.3.0
Description: 

To natively support advanced context-aware rendering for global variables across modern environments, the \Drupal\mgv\MgvPluginManager constructor has been updated to depend upon standard Drupal context resolution engines.

In mgv:2.3.0, two new parameter requirements were appended to the constructor of MgvPluginManager:

  • \Drupal\Core\Plugin\Context\ContextRepositoryInterface $contextRepository
  • \Drupal\Core\Plugin\Context\ContextHandlerInterface $contextHandler

Passing these arguments dynamically is conditionally backward-compatible in 2.3.0 utilizing \Drupal::service(...) fallbacks, but doing so triggers a deprecation warning and will be rigidly required in mgv:3.0.0.

Before (MGV 2.2.x and earlier):

  public function __construct(
    \Traversable $namespaces,
    CacheBackendInterface $cache_backend,
    ModuleHandlerInterface $module_handler
  ) {

After (MGV 2.3.x and later):

  public function __construct(
    \Traversable $namespaces,
    CacheBackendInterface $cache_backend,
    ModuleHandlerInterface $module_handler,
    ?ContextRepositoryInterface $contextRepository = NULL,
    ?ContextHandlerInterface $contextHandler = NULL
  ) {

Note: Any modules extending or statically initializing MgvPluginManager must be updated to inject @context.repository and @context.handler immediately.

Impacts: 
Module developers
Themers