I have noticed that when I uninstall a module it is still seen as disabled in modules list and files are not removed from /modules folder. I wonder if I have some issue with permission settings or is it an intended behavior? If the latter is true then what is the difference between deactivated and uninstalled module? Right now I have to manually delete uninstalled modules to keep it all clean and tidy.

Accepted answer

> (...) when I uninstall a module it is still seen as disabled in modules list and files are not removed from /modules folder. I wonder if I have some issue with permission settings or is it an intended behavior?

It's an intended behavior, or let's say it works as in Drupal 7. There is a feature request to allow deleting uninstalled projects via the user interface, but there are some concerns about it, and another suggestion in the thread is to provide a better message on the Uninstall page.

Comments

According to my experience:

Disabling a module disconnects it from the system, it stops working, its functionality is no longer available.

However, any settings made to the module are kept in the configuration and if  you activate again later this module these settings are available and do not need to be redone.

Uninstalling the module not only disconnects it from the system, but also deletes all settings from the configuration.

Only when the module is both deactivated and then uninstalled, it's files can be deleted from the /modules folder. I personally do this via FTP access to the modules folder and manually delete the module folder.

Deleting the files of a module that has been deactivated but not uninstalled is wrong and may cause error messages from the system as well as future problems (I have had them with Drupal 6/7).

It is appropriate to uninstall and then delete (files of) modules that are certain that they will no longer be used to maintain the system configuration in an optimum (smaller) size, as well as to avoid potential conflicts with modules that would be installed in the future and may have conflicts with a deactivated but not uninstalled modules.

Deleting the module files is important for the smaller system size with a view to making backups, and to remove the module from the system's list of modules.

Also I assume that the presence in the folder /modules of modules that are not used slows down the operation of the system because when the system work it  "reads" what modules there are in the folder /modules, then "checks" their settings even to "understand" that they are deactivated / ininstalled and it takes CPU time.

 

Olafski's picture

> (...) when I uninstall a module it is still seen as disabled in modules list and files are not removed from /modules folder. I wonder if I have some issue with permission settings or is it an intended behavior?

It's an intended behavior, or let's say it works as in Drupal 7. There is a feature request to allow deleting uninstalled projects via the user interface, but there are some concerns about it, and another suggestion in the thread is to provide a better message on the Uninstall page.

Thank you all for the responses. Now it makes much more sense to me. I had a look at the feature request mentioned by @Olafski and now get the picture. For me it seems logical to remove the contributed module files when uninstalling it but I understand all care should be taken regarding security issues.