When the _install hook is invoked in devel_reinstall_submit(), the relevant module's .install file is not loaded.

Patch attached that adds module_load_install()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anders.fajerson’s picture

Version: 7.x-1.x-dev » 5.x-1.x-dev
FileSize
887 bytes

Tested and works as expected. If a module tries to create tables that already exist there will be an error message, which shouldn't be a big problem.

I've added module_invoke($module, 'uninstall'); which fixes that problem if the module are doing the right thing and uninstalling its tables.

This patch is for 5.x

anders.fajerson’s picture

FileSize
1.98 KB

Updated the text to follow the new behavior. Not really sure about this but here is my take:

Clicking a module's reinstall button will simulate uninstalling/installing a module. hook_uninstall() and hook_install() will be executed and the schema version number will be set to the most recent update number. You may have to manually clear out any existing tables first if the module doesn't implement hook_uninstall.

anders.fajerson’s picture

FileSize
1.96 KB

Added missing colons to the last hook_uninstall in the text.

moshe weitzman@drupal.org’s picture

looks sane to me. would be nice to get another opinion, ideally from drumm who authored this feature.

moshe weitzman@drupal.org’s picture

the reinstall page with its column of buttons is pretty ugly. i'd enjoy ideas or a patch which improves this.

Stefan Nagtegaal’s picture

I think it's better to have a 2 column table, with checkboxes in the first column, and the module names in the second column.
The one subm it button that says 'Reinstall selected modules', and that would work fine. And is more consistent with the rest of drupal atm...

Stefan

moshe weitzman@drupal.org’s picture

Status: Needs review » Fixed

committed. thx.

Anonymous’s picture

Status: Fixed » Closed (fixed)