From 70ec93e4af025fb2935f6f8594508936b5d0f817 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Fri, 7 Jun 2013 14:14:54 +1200 Subject: [PATCH] Issue CRM-12775. If we are in CLI, do not fail for lack of ability to insert to HTML HEAD. --- CRM/Upgrade/Incremental/php/FourThree.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index de3a5d37a4..e6469cff87 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -63,14 +63,14 @@ class CRM_Upgrade_Incremental_php_FourThree { } } if ($rev == '4.3.beta4' && CRM_Utils_Constant::value('CIVICRM_UF', FALSE) == 'Drupal6') { - // CRM-11823 - Make sure the D6 HTML HEAD technique will work on upgrade pages - theme('item_list', array()); // force-load theme registry - $theme_registry = theme_get_registry(); - if ( - !isset($theme_registry['page']['preprocess functions']) || - FALSE === array_search('civicrm_preprocess_page_inject', $theme_registry['page']['preprocess functions']) - ) { - CRM_Core_Error::fatal('Please reset the Drupal cache (Administer => Site Configuration => Performance => Clear cached data))'); + // CRM-11823 - Make sure the D6 HTML HEAD technique will work on + // upgrade pages ... except when we're in Drush. + if (!function_exists('drush_main')) { + theme('item_list', array()); // force-load theme registry + $theme_registry = theme_get_registry(); + if (!isset($theme_registry['page']['preprocess functions']) || FALSE === array_search('civicrm_preprocess_page_inject', $theme_registry['page']['preprocess functions'])) { + CRM_Core_Error::fatal('Please reset the Drupal cache (Administer => Site Configuration => Performance => Clear cached data))'); + } } } } -- 2.25.1