Hello,
I've been developing a module for a Drupal 5.2 site of mine. The module creates two additional database tables, during the installation procedure.
My question is: In case I want to disable the module and then uninstall it, I would like to ask the user if he would like the tables dropped or not. Can something like this be done in the uninstall() hook? What I would like is to prompt the user with an option "Do you want the tables dropped?" and according to his input, the corresponding action would be performed.
Regards,
If you write the uninstall hook to drop tables it becomes and option for the user to select. They are presented with an "uninstall" tab on the modules page. After disabling a module the user can click this tab to confirm dropping databases. In short Drupal's default functionality is extremely similar to what you describe.
On 7/29/07, Vasileios Lourdas lourdas_v@yahoo.gr wrote:
Hello,
I've been developing a module for a Drupal 5.2 site of mine. The module creates two additional database tables, during the installation procedure.
My question is: In case I want to disable the module and then uninstall it, I would like to ask the user if he would like the tables dropped or not. Can something like this be done in the uninstall() hook? What I would like is to prompt the user with an option "Do you want the tables dropped?" and according to his input, the corresponding action would be performed.
Regards,
# Vasileios Lourdas, # Informatics Engineer, Thessaloniki (Greece)
# http://www.lourdas.name
[ Drupal support list | http://lists.drupal.org/ ]
On Sunday 29 July 2007 17:43:11 Cyberswat wrote:
If you write the uninstall hook to drop tables it becomes and option for the user to select. They are presented with an "uninstall" tab on the modules page. After disabling a module the user can click this tab to confirm dropping databases. In short Drupal's default functionality is extremely similar to what you describe.
If you are talking about the Uninstall option that Drupal provides, after disabling a module, then I already know about this. My point is, besides the standard confirm uninstall message when selecting a module for uninstallation, can I *also* provide my own extra user option of any kind?
On Sunday 29 July 2007 17:43:11 Cyberswat wrote:
If you write the uninstall hook to drop tables it becomes and option for the user to select. They are presented with an "uninstall" tab on the modules page. After disabling a module the user can click this tab to confirm dropping databases. In short Drupal's default functionality is extremely similar to what you describe.
I've just tried your suggestion. In uninstall() hook, I placed two db_query() statements that drop the tables. I disabled the module, visited the uninstall tab, clicked on the module to uninstall, however, no extra confirmation (besides the standard one) was offered.
Any ideas?