dev/core#4076 split up the theme method
authorHerb v/d Dool <herb@3speedhub.com>
Wed, 11 Jan 2023 21:55:20 +0000 (16:55 -0500)
committerHerb v/d Dool <herb@3speedhub.com>
Mon, 13 Feb 2023 18:34:34 +0000 (13:34 -0500)
CRM/Utils/System/Drupal8.php

index c0f18e1f6e9f2ab82efba2407fbfcbd6f055e654..d5a6034015975ab8cd3c8ad0970aa1c980e7d0ce 100644 (file)
@@ -919,29 +919,10 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
    * @inheritdoc
    */
   public function theme(&$content, $print = FALSE, $maintenance = FALSE) {
-    $ret = FALSE;
-
-    if (!$print) {
-      if ($maintenance) {
-        if ($region = CRM_Core_Region::instance('html-header', FALSE)) {
-          CRM_Utils_System::addHTMLHead($region->render(''));
-        }
-        $renderer = \Drupal::service('bare_html_page_renderer');
-        $response = $renderer->renderBarePage($content, '', 'maintenance_page');
-        print $response->getContent();
-        exit();
-      }
-      $ret = TRUE;
-    }
-    $out = $content;
-
-    if ($ret) {
-      return $out;
-    }
-    else {
-      print $out;
-      return NULL;
-    }
+    // @todo use Drupal "maintenance page" template and theme during installation
+    // or upgrade.
+    print $content;
+    return NULL;
   }
 
 }