Skip to content
Snippets Groups Projects
Commit c20c8783 authored by Dimitris Bozelos's avatar Dimitris Bozelos
Browse files

Issue #3422808 Use relation type manager instead of enabler manager

parent 1f67ff4d
No related branches found
No related tags found
No related merge requests found
......@@ -17,29 +17,27 @@ use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_ENTITY_TYPE_insert().
*
* Clear the cached group content enabler plugin definitions when a new product
* Clear the cached group relation type plugin definitions when a new product
* type is created so that it can be recognized without having to rebuild
* caches.
*/
function commerceg_product_commerce_product_type_insert(
ProductTypeInterface $product_type
) {
\Drupal::service('plugin.manager.group_content_enabler')
->clearCachedDefinitions();
\Drupal::service('group_relation_type.manager')->clearCachedDefinitions();
}
/**
* Implements hook_ENTITY_TYPE_delete().
*
* Clear the cached group content enabler plugin definitions when an existing
* Clear the cached group relation type plugin definitions when an existing
* product type is deleted so that it can be removed from the available plugins
* without having to rebuild caches.
*/
function commerceg_product_commerce_product_type_delete(
ProductTypeInterface $product_type
) {
\Drupal::service('plugin.manager.group_content_enabler')
->clearCachedDefinitions();
\Drupal::service('group_relation_type.manager')->clearCachedDefinitions();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment