Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0
Description: 

Most plugins have at least a human readable name on them. That name is not used often, but since it is in the definition and was translated when the definition was discovered, plugin definitions were cached by language. #2244447: Translation of low-level info/annotations leads to circular dependencies made the translation happen later on for annotation based plugin discovery, so the definition stores/serialises a future translatable object instead of the translation itself and translates it at runtime. This made plugin definitions language independent, but caching was still language specific.

Thanks to the above, we now made plugin definition caching not depend on languages by default. This change modifies the constructors of most plugin managers.

DefaultPluginManager has no LanguageManager injected anymore and it does not have a languageManager property on it. Plugin managers that need a language manager should define the property on their own.

More importantly DefaultPluginManager::setCacheBackend()'s arguments now do not include the language manager. In place of the $cache_key_prefix that used to be combined with the language code there is a dedicated $cache_key which should include the language code only if needed. The following plugin managers now cache without language and have no LanguageManager injected in their constructor anymore:

  • ActionManager
  • ArchiverManager
  • ConditionManager
  • FieldTypePluginManager
  • FormatterPluginManager
  • WidgetPluginManager
  • ImageToolkitManager
  • MailManager
  • TypedDataManager
  • ConstraintManager
  • AggregatorPluginManager
  • BlockManager
  • CKEditorPluginManager
  • EditorManager
  • SelectionPluginManager
  • FilterPluginManager
  • ImageEffectManager
  • MigrateDestinationPluginManager
  • MigratePluginManager
  • InPlaceEditorManager
  • ResourcePluginManager
  • SearchPluginManager
  • TipPluginManager
  • ViewsHandlerManager
  • ViewsPluginManager

The following plugin managers use a different discovery mechanism than annotations (yaml files or info hooks) and still cache by language and therefore pass on a cache key that includes the language:

  • ContextualLinkManager
  • LocalActionManager
  • LocalTaskManager
  • ConfigMapperManager

The EntityManager does not cache plugin definitions (entity types) by language anymore but still receives a LanguageManager which is used for field definitions and bundle caches.

Finally, DefaultPluginManager::clearCachedDefinitions() does not remove all cached variants for all languages automatically anymore unless a cache tag is provided that is common to all by-language caches.

Impacts: 
Module developers