Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
devel-reinstall.patch | 289 bytes | JvE | |
Comments
Comment #1
salvisWhy 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.
Comment #2
JvE CreditAttribution: JvE commentedNo, 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.
Comment #3
salvisInteresting, 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.
Comment #4
JvE CreditAttribution: JvE commentedNo, 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.
Comment #5
salvisAh, I see — thanks for enlightening me.
Committed to D8/D7.