Feature Wiki
Tabs
Ask removing plugin data on uninstall
Page Overview
[Hide]1 Initial Problem
- If you uninstall an ILIAS plugin and it implements the uninstall, the plugin data will be removed always. The user should be informed about this process and should confirm, that he want to do this or not. So the user doesn't delete accidently important data and he can later use the data again, if he install the plugin again. So ILIAS plugins developer are no longer in dilemma to implement the plugin uninstaller
- The current implementation of the uninstall method in the plugin class is bad and a bit confusing. In most plugin types is calling this 'beforeUninstall' and 'afterUninstall' (Voluntary), but in the repository object it calls 'beforeUninstallCustom' and 'uninstallCustom' (abstract). Each plugin implement this different. This should be simplified to an single abstarct method like 'removeData' for all plugin types the same
2 Conceptual Summary
- After the user click on 'Uninstall' action on a plugin, the confirm dialog will be adapted. Instead a simple 'Yes' and 'Cancel', the follow actions are offered: 'Remove plugin data', 'Keep plugin data', 'Just deactivate plugin', 'Cancel'. Also the confirm text changes to like 'Are you sure you want to uninstall the plugin "%s"? Do you want to remove the %s data as well? At most, you just want to disable the %s plugin?'
- See more in '4 Technical Information'
3 User Interface Modifications
3.1 List of Affected Views
The confirm page on uninstall a plugin will adapted
It looks lilke:
![](./data/docu/mobs/mm_65694/ConfirmPluginUninstall.png?il_wac_token=7d3594b47ab7860fc7d39283f761941bba9cdf88&il_wac_ttl=5&il_wac_ts=1725755651)
3.2 User Interface Details
- If the user click on 'Remove plugin data', the plugin will uninstall and the plugin removeData in the plugin class will call.
- If the user click on 'Kee plugin data', the plugin will uninstall and the plugin removeData in the plugin class will not call.
- If the user click on 'Just deactivate plugin', the plugin will not unistall and the plugin removeData will not call and the plugin will disable.
- If the user click on 'Cancel', no actions will done and the user will redirect to the plugin list (Like before)
3.3 New User Interface Concepts
None
4 Technical Information
Define an new abtract method like 'removeData' in 'ilPlugin'. Refactoring 'ilPlugin' to always use this mehod for all plugin types ('ilRepositoryObjectPlugin' muss also refactored). Also remove the old 'beforeUninstall', 'afterUninstall', 'beforeUninstallCustom', 'uninstallCustom' method definition.
This has the consequence, that all ILIAS plugins needs to rewriten for ILIAS 6.0
But this is a small effort, they only need to implement the new abstract method 'removeData'. They could it let also empty ...
Voluntary is to move the old plugin uninstaller code inside 'removeData' and remove the old methods ('beforeUninstall', 'afterUninstall', 'beforeUninstallCustom', 'uninstallCustom') for clean up their plugin class
If they need support for old ILIAS versions, the could call 'removeData' from the old methods ('beforeUninstall', ...) to avoid duplicated code
Changes will be made in 'ilObjComponentSettingsGUI', 'ilPlugin', 'ilRepositoryObjectPlugin' class (And may also other plugin types class). Also add some new needed language variables and change exists
It already exists a plugin specific implementation, integrated via composer (https://github.com/studer-raimann/RemovePluginDataConfirm).
Some studer+raimann ag plugins are using this already, like LiveVoting (https://github.com/studer-raimann/LiveVoting/blob/de04a795b0a04ff20cfc39fffb82272cc6ce79d5/classes/class.ilLiveVotingPlugin.php#L73).
Should this feature be accepted in ILIAS core, it is being implemented of course without the Trait, without the additional GUI class and without composer (Just was not possible otherwise without change the ILIAS core code. Also it was here not possible with only a single confirmation, in the plugin variante there exists now 2 confirmation guis, on ILIAS core, of course only a confirmation)
5 Contact
- Author of the Request: Studer, Martin [mstuder]
- Maintainer: Schmid, Fabian [fschmid]
- Implementation of the feature is done by:
6 Funding
None required
7 Discussion
Kunkel, Matthias [mkunkel], 01 FEB 2019 : The buttons above have pretty long lables. Do we really need to include the plugin name in the labels. The plugin itself is already mentioned in the table, here "Live Voting Data". How about generic labels like:
- Uninstall and Remove Data
- Uninstall but Keep Data
- Deactivate Plugin Only
- Cancel
JourFixe, ILIAS [jourfixe], 04 FEB 2019 : We highly appreciate this suggestion and schedule the feature for 6.0. Please consider Matthias' suggestions for labels and for lang item handling (by plugin slot instead of plugin). In a second step we should think about a concept where plugins register the tables they create. This would allow to delete plugin data of plugins that are no longer installed (or never have been installed on this installation because a dump of another has been used).
8 Implementation
{The maintainer has to give a description of the final implementation and add screenshots if possible.}
Test Cases
Test cases completed at {date} by {user}
- {Test case number linked to Testrail} : {test case title}
Approval
Approved at {date} by {user}.
Last edited: 5. Nov 2019, 09:33, Undisclosed