core/authorize.php | 20 +++++++++----------- core/modules/system/system.module | 1 - 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/core/authorize.php b/core/authorize.php index fe4b7d0..a03eb8f 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -107,11 +107,11 @@ function authorize_access_allowed() { drupal_set_message($results['page_message']['message'], $results['page_message']['type']); } - $authorize_report = array( + $content = []; + $content['authorize_report'] = array( '#theme' => 'authorize_report', '#messages' => $results['messages'], ); - $output = drupal_render_root($authorize_report); $links = array(); if (is_array($results['tasks'])) { @@ -124,25 +124,23 @@ function authorize_access_allowed() { )); } - $item_list = array( + $content['next_steps'] = array( '#theme' => 'item_list', '#items' => $links, '#title' => t('Next steps'), ); - $output .= drupal_render_root($item_list); } // If a batch is running, let it run. elseif ($request->query->has('batch')) { - $output = _batch_page($request); + $content = ['#markup' => _batch_page($request)]; } else { if (empty($_SESSION['authorize_operation']) || empty($_SESSION['authorize_filetransfer_info'])) { - $output = t('It appears you have reached this page in error.'); + $content = ['#markup' => t('It appears you have reached this page in error.')]; } elseif (!$batch = batch_get()) { // We have a batch to process, show the filetransfer form. - $elements = \Drupal::formBuilder()->getForm('Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm'); - $output = drupal_render_root($elements); + $content = \Drupal::formBuilder()->getForm('Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm'); } } // We defer the display of messages until all operations are done. @@ -152,12 +150,12 @@ function authorize_access_allowed() { $response->setStatusCode(403); \Drupal::logger('access denied')->warning('authorize.php'); $page_title = t('Access denied'); - $output = t('You are not allowed to access this page.'); + $content = ['#markup' => t('You are not allowed to access this page.')]; } -if (!empty($output)) { +if (!empty($content)) { $response->headers->set('Content-Type', 'text/html; charset=utf-8'); - $response->setContent(\Drupal::service('bare_html_page_renderer')->renderBarePage(['#markup' => $output], $page_title, 'maintenance_page', array( + $response->setContent(\Drupal::service('bare_html_page_renderer')->renderBarePage($content, $page_title, 'maintenance_page', array( '#show_messages' => $show_messages, ))); $response->send(); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 131077d..9334a88 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -526,7 +526,6 @@ function system_filetransfer_info() { */ function system_page_attachments(array &$page) { // Ensure the same CSS is loaded in template_preprocess_maintenance_page(). - $page['#attached']['library'][] = 'core/drupal.states'; $page['#attached']['library'][] = 'core/normalize'; $page['#attached']['library'][] = 'system/base'; if (\Drupal::service('router.admin_context')->isAdminRoute()) {