Can't uninstall the module through admin UI

Created on 6 September 2023, almost 2 years ago

I want to uninstall the 4.x then reinstall the 3.x, but it's showing on the uninstall page "The Simplenews issue field type is used in the following field: node.simplenews_issueโ€œ so the simplenews module can't be uninstall , so what can I do to uninstall the module ? I installed through the "/admin/modules/install" page before.

๐Ÿ’ฌ Support request
Status

Active

Version

4.0

Component

Usability

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom freelylw

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

Comments & Activities

  • Issue created by @freelylw
  • Assigned to viren18febs
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia viren18febs

    Checking the issue!

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia viren18febs

    Hi @freelylw

    For uninstall the module go to Configuration > Web services > Simplenews > Settings and hit "Prepare uninstall".

  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi @freelylw,

    I followed the steps given by viren18febS (it is also stated in the module the same instructions) and I confirmed that I was able to uninstall the Simplenews module.

    Please look at the screenshot I attached for your reference,

    Thank you.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany umac_de

    Same Problem here with node.simplenews_issue field

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States seanr

    Following these steps does not work for me. After running that purge, I still get the same error when running drush pmu -y simplenews. For some reason, this isn't removing the simplenews_issue field, leaving the module still unable to be installed:

      /**
       * Removes Simplenews fields.
       */
      public static function removeFields() {
        $field_config_storage = \Drupal::entityTypeManager()->getStorage('field_config');
        $simplenews_fields_ids = $field_config_storage->getQuery()
          ->condition('field_type', 'simplenews_', 'STARTS_WITH')->execute();
        $simplenews_fields = $field_config_storage->loadMultiple($simplenews_fields_ids);
    
        $field_config_storage->delete($simplenews_fields);
      }
    
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States seanr

    OK, I found a workaround for this. I ran the prepare uninstall process as described, but still couldn't uninstall, so I manually removed all references to simplenews from the config (deleted all config files specific to simplenews and then edited out references to it in the others). Then drush cim uninstalled it as expected. I would not expect anyone without significant Drupal development experience to even think of that let alone know how to do it safely, so there is obviously work to be done on the module itself. I think a proper hook_uninstall implementation or something is needed here.

Production build 0.71.5 2024