uninstall module that depends on relation module, which is disabled

in flag

I am a maintainer of the crm_core module. The Drupal7 version depends on the relation module to provide relationships between contacts. The depend module can not be uninstalled while the relation module is disabled.

Is there a solution? Or, is this one of the limitations of disabling modules, which might be why disable was dropped in Drupal8.

2273255 - Can't uninstall crm_core_relationship when relation module has been disabled

us flag

The issue described in Can't uninstall crm_core_relationship when relation module has been disabled is that crm_core_relationship_uninstall() is calling functions defined in a disabled module. When a module is disabled, Drupal won't load it, and all the module functions won't be available.

Either crm_core_relationship_uninstall() first loads that module file with drupal_load('module', 'relation'), before calling its functions, or the code in relation_delete() and relation_type_delete() is duplicated in functions accessible from crm_core_relationship_uninstall().

That issue isn't present in Drupal 8, as in Drupal 8 modules can only installed or not installed; they cannot be anymore disabled as in Drupal 7.

Binary Alchemist avatar
in flag
I used the drupal_load function, and it works! [changes](
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.