If you enable mailchimp_campaign and add a campaign, you can't uninstall mailchimp_campaign because the campaign exists.

Error message:
exception 'Drupal\Core\Extension\ModuleUninstallValidatorException' [error]
with message 'The following reasons prevents the modules from being
uninstalled: There is content for the entity type: Mailchimp
Campaign' in
/Users/toto/Sites/d8-bookclub-capstone/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:347

A similar approach to those in the following issue will probably work, though I'd also like to prompt the user before deleting their campaigns.
https://www.drupal.org/node/2585215

Comments

jami created an issue. See original summary.

asrob’s picture

AhmadZain’s picture

this issue exist yes .. and if you accept deleting the mailchimp_campaign table records it will be uninstalled however and i think this should be another issue .. navigating to the campaign after changing the account ID giving exceptional error

asrob’s picture

I can confirm that AhmadZain said. Cannot uninstall mailchimp_campaign if a campaign exists.

AhmadZain’s picture

any updates regarding this one ?

samuel.mortenson’s picture

Status: Active » Closed (won't fix)

I think this is expected behavior with all modules providing Entity Types, otherwise an uninstall could lead to data loss. The approach from #2585215: Mailchimp Campaign cannot be uninstalled was reverted recently so I don't think it would be a good option here.