CRM-13897 - Update script not runs under wordpress
authorDonald A. Lobo <lobo@civicrm.org>
Tue, 3 Dec 2013 14:49:48 +0000 (06:49 -0800)
committerDonald A. Lobo <lobo@civicrm.org>
Tue, 3 Dec 2013 14:49:48 +0000 (06:49 -0800)
http://issues.civicrm.org/jira/browse/CRM-13897

CRM/Utils/System/Base.php

index e9acb7df1a1e9e58a8b0969715213585f344cb13..2cae071dadf728757277e1f8c8d43f5288038c14 100644 (file)
@@ -29,7 +29,12 @@ abstract class CRM_Utils_System_Base {
 
     // TODO: Split up; this was copied verbatim from CiviCRM 4.0's multi-UF theming function
     // but the parts should be copied into cleaner subclass implementations
-    if (function_exists('theme') && !$print) {
+    $config = CRM_Core_Config::singleton();
+    if (
+      $config->userSystem->is_drupal &&
+      function_exists('theme') &&
+      !$print
+    ) {
       if ($maintenance) {
         drupal_set_breadcrumb('');
         drupal_maintenance_theme();
@@ -44,7 +49,8 @@ abstract class CRM_Utils_System_Base {
     $out = $content;
 
     $config = &CRM_Core_Config::singleton();
-    if (!$print &&
+    if (
+      !$print &&
       $config->userFramework == 'WordPress'
     ) {
       if (is_admin()) {