diff --git a/includes/module.inc b/includes/module.inc index 500bc5e..3067c24 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -421,10 +421,18 @@ function module_enable($module_list, $enable_dependencies = TRUE) { module_list(TRUE); module_implements('', FALSE, TRUE); _system_update_bootstrap_status(); - // Update the registry to include it. - registry_update(); - // Refresh the schema to include it. - drupal_get_schema(NULL, TRUE); + // ------- PATCH FOR ISSUE 1311828 AND OTHERS --------- + // registry_update() is moved down during installation in this method + // because it breaks profile installation due to interactions + // with ctools and other modules - code assuming a schema exists + // prior to it being created. + if (variable_get('install_task') == 'done') { + // Update the registry to include it. + registry_update(); + // Refresh the schema to include it. + drupal_get_schema(NULL, TRUE); + } + // ------- END PATCH ---------------- // Update the theme registry to include it. drupal_theme_rebuild(); // Clear entity cache. @@ -456,6 +464,16 @@ function module_enable($module_list, $enable_dependencies = TRUE) { // Enable the module. module_invoke($module, 'enable'); + // ------- PATCH FOR ISSUE 1311828 AND OTHERS (SEE ABOVE IN THIS FUNCTION) --------- + if (variable_get('install_task') != 'done') { + // Update the registry to include it. + registry_update(); + // Refresh the schema to include it. + drupal_get_schema(NULL, TRUE); + } + // ------- END PATCH ---------------- + + // Record the fact that it was enabled. $modules_enabled[] = $module; watchdog('system', '%module module enabled.', array('%module' => $module), WATCHDOG_INFO);