/** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); if ($event_type = reset($entities)) { EventType::courierContextCC($event_type->entity_type, 'delete'); } // Rebuild routes and local tasks. \Drupal::service('router.builder')->setRebuildNeeded(); // Rebuild local actions https://github.com/dpi/rng/issues/18 \Drupal::service('plugin.manager.menu.local_action')->clearCachedDefinitions(); }