FlushDrupal.civi-setup.php - Update to work with setup UI
authorTim Otten <totten@civicrm.org>
Mon, 6 Jul 2020 08:18:49 +0000 (01:18 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 6 Jul 2020 08:56:13 +0000 (01:56 -0700)
setup/plugins/installDatabase/FlushDrupal.civi-setup.php

index d761cb7a33e97a58f3a0da4128fe8bec94d4b81a..ef2bb25cc2fd0c7bec54fead7d53242985cfaf5b 100644 (file)
@@ -16,6 +16,13 @@ if (!defined('CIVI_SETUP')) {
     }
     \Civi\Setup::log()->info(sprintf('[%s] Flush CMS metadata', basename(__FILE__)));
 
+    // If the admin activated the module first, and then ran web-based installer,
+    // then some hooks (eg hook_menu) may not fire until we fix this flag.
+    $initialized = &drupal_static('civicrm_initialize', FALSE);
+    $failure = &drupal_static('civicrm_initialize_failure', FALSE);
+    $initialized = TRUE;
+    $failure = FALSE;
+
     system_rebuild_module_data();
     module_enable(array('civicrm', 'civicrmtheme'));
     drupal_flush_all_caches();