"Manage Extensions" - Allow deleting unused extensions
Overview
The "Manage Extensions" UI allows you to download extensions. It does not allow you delete extensions... ever.
Example use-case
The web-user goes through this process...
- Download and enable the "Ice Cream" extension
- Download and enable the "Cherry Pie" extension
- Download and enable the "Gulab Jamun" extension
- Disable and uninstall the "Ice Cream" extension
- Disable and uninstall the "Cherry Pie" extension
- Disable and uninstall the "Gulab Jamun" extension
Current behaviour
The inactive extensions add noise to the "Manage Extensions" UI.
The web user is stuck with inactive extensions "Ice Cream", "Cherry Pie", and "Gulab Jamun".
Proposed behaviour
Add a "Delete" button. "Delete" is only supported if these conditions are met:
- Ext status is "Uninstalled" (no db content)
- Ext lives in the "default container" (
[civicrm.files]/ext
) - Ext is writable by current POSIX user
- Ext does not have any other ext's underneath it
- Web-user has permission to manage exts
- (Undecided: If there are multiple copies of an ext, do we still allow deleting the copy in
[civicrm.files]/ext
? I think probably so...)
Comments
The pre-conditions above should ensure that we don't (eg) delete extensions that live in vendor/
or civicrm/ext/
. Those extensions usually aren't managed via web UI (eg they're managed by composer install
or tar xvzf civicrm-XYZ.tar.gz
), and they may be shared in multitenant deployments.
The "Delete" button is not necessarily something to take too lightly. Perhaps it goes in expanded/drill-down section? Maybe next to the "Local Path"?
If a user gets into a situation where they want to delete an extension but cannot, then (1) there should be an indication of why "Delete" is unsupported, and (2) we may want to suggest manual/CLI-based deletion as an alternative.