Commit 5d83ca57 authored by alexpott's avatar alexpott

Issue #2008954 by markie: Replace theme() with drupal_render() in /core/lib.

parent b61918f0
......@@ -1260,7 +1260,12 @@ function render() {
$output .= $piece;
}
else {
$output .= theme('diff_inline_chunk', array('text' => $piece, 'type' => $chunk->type));
$diff_inline_chunk = array(
'#theme' => 'diff_inline_chunk',
'#text' => $piece,
'#type' => $chunk->type,
);
$output .= drupal_render($diff_inline_chunk);
}
}
break;
......@@ -1271,7 +1276,12 @@ function render() {
$output .= $piece;
}
else {
$output .= theme('diff_inline_chunk', array('text' => $piece, 'type' => $chunk->type));
$diff_inline_chunk = array(
'#theme' => 'diff_inline_chunk',
'#text' => $piece,
'#type' => $chunk->type,
);
$output .= drupal_render($diff_inline_chunk);
}
}
break;
......
......@@ -67,9 +67,10 @@ public function content(Request $request, $_content) {
// replace the element making the ajax call. The default 'replaceWith'
// behavior can be changed with #ajax['method'].
$response->addCommand(new InsertCommand(NULL, $html));
$status_messages = theme('status_messages');
if (!empty($status_messages)) {
$response->addCommand(new PrependCommand(NULL, $status_messages));
$status_messages = array('#theme' => 'status_messages');
$output = drupal_render($status_messages);
if (!empty($output)) {
$response->addCommand(new PrependCommand(NULL, $output));
}
}
}
......
......@@ -255,7 +255,11 @@ public function on500Html(FlattenException $exception, Request $request) {
drupal_set_title(t('Error'));
// We fallback to a maintenance page at this point, because the page
// generation itself can generate errors.
$output = theme('maintenance_page', array('content' => t('The website has encountered an error. Please try again later.')));
$maintenance_page = array(
'#theme' => 'maintenance_page',
'#content' => t('The website has encountered an error. Please try again later.'),
);
$output = drupal_render($maintenance_page);
$response = new Response($output, 500);
$response->setStatusCode(500, '500 Service unavailable (with message)');
......
......@@ -45,7 +45,13 @@ public function onKernelRequestMaintenance(GetResponseEvent $event) {
// Deliver the 503 page.
drupal_maintenance_theme();
drupal_set_title(t('Site under maintenance'));
$content = theme('maintenance_page', array('content' => filter_xss_admin(t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name'))))));
$maintenance_page = array(
'#theme' => 'maintenance_page',
'#content' => filter_xss_admin(
t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name')))
),
);
$content = drupal_render($maintenance_page);
$response = new Response('Service unavailable', 503);
$response->setContent($content);
$event->setResponse($response);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment