- πΊπΈUnited States dave reid Nebraska USA
Should access tokens automatically get deleted when the host entity is deleted? Maybe we're missing that link?
- πΊπΈUnited States dave reid Nebraska USA
I would probably prefer to see "Deleted" instead of nothing.
- Issue was unassigned.
- π©πͺGermany IT-Cru Munich
@Dave Reid: There is already a hook_entity_delete() implemented since 5 years in the module. So normally all access tokens should be deleted, when a host entity gets deleted.
/** * Implements hook_entity_delete(). */ function access_unpublished_entity_delete(EntityInterface $entity) { /** @var \Drupal\access_unpublished\AccessTokenManager $tokenManager */ $tokenManager = \Drupal::service('access_unpublished.access_token_manager'); foreach ($tokenManager->getAccessTokensByEntity($entity) as $token) { $token->delete(); } }