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

Config entities implementing EntityWithPluginCollectionInterface should ask the plugins to react when their dependencies are removed

$
0
0

Problem/Motivation

When a config entity implementing EntityWithPluginCollectionInterface is reacting on dependency removal, it should ask the plugins from the collections if they want to take some action when their dependencies are about to be removed.

This issue is adding a generic solution for the one fixed in #2562107: EntityDisplayBase should react on removal of its components dependencies.

Proposed resolution

  1. Add code in ConfigEntityBase::onDependencyRemoval() that tests if the entity implements EntityWithPluginCollectionInterface. If so, iterate through collections and if there are specific plugin dependencies being removed, call the plugin ::onDependencyRemoval() method to allow the plugin to react.
  2. Add a new method onDependencyRemoval() in \Drupal\Component\Plugin\DependentPluginInterface.
  3. Add empty onDependencyRemoval() implementations in base classes implementing DependentPluginInterface with a simple return FALSE;.
  4. Implement one use-case.
  5. Tests.

is reacting on dependency removal, it should ask the plugins from the collections if they want to take some action when their dependencies are about to be removed.

Remaining tasks

None.

User interface changes

None.

API changes

New method \Drupal\Component\Plugin\DependentPluginInterface::onDependencyRemoval().

Data model changes

None.


Viewing all articles
Browse latest Browse all 293279

Trending Articles



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