hook_ENTITY_TYPE_translation_delete not called

Created on 5 June 2017, about 7 years ago
Updated 15 February 2023, over 1 year ago

Problem/Motivation

hook_ENTITY_TYPE_translation_delete not called when an entity is deleted.

Steps to reproduce

To reproduce:

  1. Write a hook_ENTITY_TYPE_delete implementation and put a \Drupal::logger(__FUNCTION__)->notice(__FUNCTION__) inside of it
  2. Write a hook_ENTITY_TYPE_translation_delete implementation and put a \Drupal::logger(__FUNCTION__)->notice(__FUNCTION__) inside of it
  3. Create a node in the site default language
  4. Translate the node into another language
  5. Delete the node in the default language

Expected result:

  1. You see the notice that the node will be deleted in all the languages
  2. You get a log message that shows hook_ENTITY_TYPE_delete was called
  3. You get a log message that shows hook_ENTITY_TYPE_translation_delete was called

Actual result:

  1. You see the notice that the node will be deleted in all the languages
  2. You get a log message that shows hook_ENTITY_TYPE_delete was called
  3. You DO NOT get a log message that shows hook_ENTITY_TYPE_translation_delete was called

Note: If you directly delete a given translation you DO get a log message that shows that hook_ENTITY_TYPE_translation_delete was called.

Proposed resolution

Update hook documentation

Remaining tasks

Patch
Review
Make followup, #17
commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ“Œ Task
Status

Needs work

Version

10.0 ✨

Component
EntityΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States vegantriathlete Lakewood, CO

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024