Orphaned field is left behind upon uninstalling the module

Created on 20 May 2024, about 1 year ago

Steps to Reproduce:

1. Install and enable the contrib module providing the link media type with 'field_media_link'.
2. Create another media type using the "Link" media type as the source, inheriting 'field_media_link'.
3. Uninstall media_entity_link module.

Expected Behavior:
Upon uninstalling the module, the link media type should be deleted along with the field_media_link.

Actual behavior:
Upon uninstallation, its leaving behind an orphaned database field (field_media_link).

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India renukakulkarni

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

Comments & Activities

  • Issue created by @renukakulkarni
  • 🇬🇧United Kingdom d.fisher

    Have managed to reproduce this. The field storage is left orphaned. However would that not be the desired behavior if the field has been used on another media type? I created a new media type called "another_link" and then uninstalled the module. My new media type "another_link" was removed when the module was uninstalled which I'd argue is perhaps not desirable.

    My question is what do we expect to happen when the module is uninstalled?

    1. Any media type using the field.storage.media.field_media_entity_link should be deleted along with the field storage?
    2. A check should be performed to see if any other media types are using the field storage and if so do not delete the field storage or any media types that are using it except for the one provided by the media_entity_link module?

    I'm going to set this as maintainer needs more info until we can reach a consensus on what the correct behavior should be!

Production build 0.71.5 2024