The functionality of drupal_uninstall_modules() changed between D6 and D7 but devel does not take that into account in the "reinstall modules" functionality.
Patch supplied for review.

CommentFileSizeAuthor
devel-reinstall.patch289 bytesJvE
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

salvis’s picture

Why would this make any difference?

The default is TRUE, meaning to uninstall any dependents that are not already in the list. Your FALSE would not uninstall these dependents (which is questionable!), but really there shouldn't be any dependents that are not in the list.

JvE’s picture

No, the default TRUE does not mean that any dependent modules not in the list will be uninstalled. It means that modules that have dependents that are not in the list will not be uninstalled. It also does not give any notice that it is skipping these modules.

You used to be able to use the devel reinstall function to reinstall a module without also having to reinstall all modules that depend on it. My patch restores this functionality.

salvis’s picture

Interesting, the description on http://api.drupal.org/api/drupal/includes--install.inc/function/drupal_u... doesn't say what happens if modules are missing from the list...

You have to pass $uninstall_dependents=FALSE to tell core to uninstall the dependents? Who could have thought of that... I wonder if that's really how core is supposed to work or whether core needs fixing.

JvE’s picture

No, setting $uninstall_dependents to FALSE will not uninstall the dependents. Only supplying them in the $module_list will do that.

$uninstall_dependents = TRUE: Abort (return FALSE) if there are modules in $module_list that have dependents that are not in $module_list.
$uninstall_dependents = FALSE: Do not check for dependents, just uninstall $module_list.

I agree that the variable name is poorly chosen. $check_dependents would have been better.

devel_reinstall was never meant to uninstall module dependents (it has no mechanism of reinstalling them again), only to reinstall the selected module(s).

So adding the FALSE parameter restores the devel functionality.

salvis’s picture

Status: Needs review » Fixed

Ah, I see — thanks for enlightening me.

Committed to D8/D7.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.