Hi there,

Recently I accidentally removed a modules when switching between git branches (Webform in this case).
Drupal didn't display an warning on the site itself about the missing module.
When I did notice that the webforms were gone, I saw that the module directory was gone.

I immediately put the module back in it's place, but to my suprise this didn't fix the problem. The module was not installed anymore. I didn't take any actions before re-adding the module btw.

What was worse was that I wasn't able to re-install the module since it wasn't allowed because there was already configuration available for webforms.
So I had to remove everything first in order to re-install the module, and of course, lost all configuration in Drupal in the process...

In this particular case it wasn't a big deal, since I only created one simple form, which didn't have any submissions. So I was able to rebuild it quickly.
But on larger projects I often have multiple big forms, or if it was another more important module, then this would be very troubling...

I saw related issues in the queue, mostly about not being able to install a module after an uninstall, but nothing like this issue.

Did anyone else experience this, or am I missing something here? I sure there's a good reason for this behaviour, but this is very dangerous imo.

A solution would be to display a warning about the missing module, and re-enabling it automatically - if that's even possible atm...

Thanks!

Tijs

Comments

tijsdeboeck created an issue. See original summary.

cilefen’s picture

If any of the issues you found are close enough to be related, please reference them in the Related Issues field.

tijsdeboeck’s picture

cilefen’s picture

Title: Accidentally deleting a module directory uninstalls it, but keeps config » Leftover configuration from a once-deleted module prevents reinstallation of the module
cilefen’s picture

Title: Leftover configuration from a once-deleted module prevents reinstallation of the module » Deleting a module's file uninstalls the module, then its leftover configuration prevents reinstalling it
cilefen’s picture

Title: Deleting a module's file uninstalls the module, then its leftover configuration prevents reinstalling it » Deleting a module's files uninstalls the module, then its leftover configuration prevents reinstalling it

Ok, I'll stop now.

chandravilas’s picture

Assigned: Unassigned » chandravilas
Status: Active » Closed (works as designed)

If the module accidentally deleted or removed from repositories, In that case you will get error like this The "plugin_name" plugin does not exist.

If you want to resolve this go to file sync/core.extension.yml file and remove your module configuration(your_plugin_id : 0) from that file and clear the cache..

Or

place the missing module in repository, if error not stop then go to configuration manually remove plugin configuration from core.extension.yml and run the following drupal command..

1] Drush pm-enable // Or enable module from GUI, If admin GUI is not broken else do the same by drush command
2] Drush cr..

These are the only way to deal with this kind of issues..

chandravilas’s picture

If the module accidentally deleted or removed from repositories, In that case you will get error like this The "plugin_name" plugin does not exist.

If you want to resolve this go to file sync/core.extension.yml file and remove your module configuration(your_plugin_id : 0) from that file and clear the cache..

Or

place the missing module in repository, if error not stop then go to configuration manually remove plugin configuration from core.extension.yml and run the following drupal command..

1] Drush pm-enable // Or enable module from GUI, If admin GUI is not broken else do the same by drush command
2] Drush cr..

These are the only way to deal with this kind of issues..