summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Eskola2017-07-03 15:35:13 (GMT)
committerLauri Eskola2017-07-03 15:35:13 (GMT)
commit7f27bbaba141ff4073a89bb602cee141f2fefe1e (patch)
tree12173caaee666221954495f5451fecd063ddec75
parentb5a3346f32f3fea65ec4c1e602c702a20caa6d97 (diff)
Issue #2704871 by pepegarciag, Mile23, Manuel Garcia, ieguskiza, snehi, gaurav.pahuja, dimaro, rajeshwari10, gargsuchi, pashupathi nath gajawada, penyaskito, xjm, ZeiP, Wim Leers, alexpott: Replace usages of deprecated method drupal_render()
-rw-r--r--core/includes/common.inc2
-rw-r--r--core/includes/tablesort.inc2
-rw-r--r--core/lib/Drupal/Core/Render/Element/Tableselect.php2
-rw-r--r--core/lib/Drupal/Core/Theme/ThemeManager.php2
-rw-r--r--core/modules/action/action.views_execution.inc2
-rw-r--r--core/modules/book/book.module2
-rw-r--r--core/modules/book/src/Form/BookAdminEditForm.php2
-rw-r--r--core/modules/comment/comment.module4
-rw-r--r--core/modules/comment/src/Plugin/views/field/EntityLink.php2
-rw-r--r--core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php2
-rw-r--r--core/modules/content_translation/content_translation.admin.inc4
-rw-r--r--core/modules/contextual/src/Plugin/views/field/ContextualLinks.php2
-rw-r--r--core/modules/file/file.field.inc2
-rw-r--r--core/modules/filter/src/Plugin/Filter/FilterCaption.php2
-rw-r--r--core/modules/filter/src/Plugin/Filter/FilterHtml.php4
-rw-r--r--core/modules/forum/forum.module8
-rw-r--r--core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php2
-rw-r--r--core/modules/image/src/Form/ImageStyleEditForm.php2
-rw-r--r--core/modules/node/node.admin.inc2
-rw-r--r--core/modules/node/node.module4
-rw-r--r--core/modules/node/src/NodeListBuilder.php2
-rw-r--r--core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php2
-rw-r--r--core/modules/rdf/rdf.module4
-rw-r--r--core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php2
-rw-r--r--core/modules/simpletest/simpletest.module6
-rw-r--r--core/modules/system/tests/modules/theme_test/theme_test.module2
-rw-r--r--core/modules/taxonomy/src/Form/OverviewTerms.php2
-rw-r--r--core/modules/update/src/Form/UpdateManagerUpdate.php2
-rw-r--r--core/modules/update/update.manager.inc2
-rw-r--r--core/modules/views/src/Analyzer.php2
-rw-r--r--core/modules/views/src/Plugin/views/area/Result.php2
-rw-r--r--core/modules/views/src/Plugin/views/field/PrerenderList.php2
-rw-r--r--core/modules/views/views.module4
-rw-r--r--core/modules/views_ui/src/Form/BreakLockForm.php2
-rw-r--r--core/modules/views_ui/src/ViewEditForm.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php4
37 files changed, 50 insertions, 50 deletions
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 323a666..f40565a 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -896,7 +896,7 @@ function drupal_render_children(&$element, $children_keys = NULL) {
$output = '';
foreach ($children_keys as $key) {
if (!empty($element[$key])) {
- $output .= drupal_render($element[$key]);
+ $output .= \Drupal::service('renderer')->render($element[$key]);
}
}
return Markup::create($output);
diff --git a/core/includes/tablesort.inc b/core/includes/tablesort.inc
index d8f1624..b948fea 100644
--- a/core/includes/tablesort.inc
+++ b/core/includes/tablesort.inc
@@ -53,7 +53,7 @@ function tablesort_header(&$cell_content, array &$cell_attributes, array $header
'#theme' => 'tablesort_indicator',
'#style' => $ts['sort'],
];
- $image = drupal_render($tablesort_indicator);
+ $image = \Drupal::service('renderer')->render($tablesort_indicator);
}
else {
// If the user clicks a different header, we want to sort ascending initially.
diff --git a/core/lib/Drupal/Core/Render/Element/Tableselect.php b/core/lib/Drupal/Core/Render/Element/Tableselect.php
index a8f0e95..24eb431 100644
--- a/core/lib/Drupal/Core/Render/Element/Tableselect.php
+++ b/core/lib/Drupal/Core/Render/Element/Tableselect.php
@@ -159,7 +159,7 @@ class Tableselect extends Table {
$row += $element['#options'][$key]['#attributes'];
}
// Render the checkbox / radio element.
- $row['data'][] = drupal_render($element[$key]);
+ $row['data'][] = \Drupal::service('renderer')->render($element[$key]);
// As table.html.twig only maps header and row columns by order, create
// the correct order by iterating over the header fields.
diff --git a/core/lib/Drupal/Core/Theme/ThemeManager.php b/core/lib/Drupal/Core/Theme/ThemeManager.php
index c58d176..61f0483 100644
--- a/core/lib/Drupal/Core/Theme/ThemeManager.php
+++ b/core/lib/Drupal/Core/Theme/ThemeManager.php
@@ -303,7 +303,7 @@ class ThemeManager implements ThemeManagerInterface {
unset($preprocess_bubbleable['#cache']['keys']);
if ($preprocess_bubbleable) {
// @todo Inject the Renderer in https://www.drupal.org/node/2529438.
- drupal_render($preprocess_bubbleable);
+ \Drupal::service('renderer')->render($preprocess_bubbleable);
}
}
diff --git a/core/modules/action/action.views_execution.inc b/core/modules/action/action.views_execution.inc
index 71b8eeb..b9acfe9 100644
--- a/core/modules/action/action.views_execution.inc
+++ b/core/modules/action/action.views_execution.inc
@@ -15,6 +15,6 @@ function action_views_form_substitutions() {
'#attributes' => ['class' => ['action-table-select-all']],
];
return [
- '<!--action-bulk-form-select-all-->' => drupal_render($select_all),
+ '<!--action-bulk-form-select-all-->' => \Drupal::service('renderer')->render($select_all),
];
}
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 988201e..d0aa9b0 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -437,7 +437,7 @@ function template_preprocess_book_navigation(&$variables) {
}
if (!empty($build)) {
- drupal_render($build);
+ \Drupal::service('renderer')->render($build);
}
$variables['has_links'] = FALSE;
diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php
index e91f52e..1e7cdb4 100644
--- a/core/modules/book/src/Form/BookAdminEditForm.php
+++ b/core/modules/book/src/Form/BookAdminEditForm.php
@@ -220,7 +220,7 @@ class BookAdminEditForm extends FormBase {
}
$form[$id]['title'] = [
- '#prefix' => !empty($indentation) ? drupal_render($indentation) : '',
+ '#prefix' => !empty($indentation) ? \Drupal::service('renderer')->render($indentation) : '',
'#type' => 'textfield',
'#default_value' => $data['link']['title'],
'#maxlength' => 255,
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 48e2ae9..16949ff 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -627,7 +627,7 @@ function template_preprocess_comment(&$variables) {
'#theme' => 'username',
'#account' => $account,
];
- $variables['author'] = drupal_render($username);
+ $variables['author'] = \Drupal::service('renderer')->render($username);
$variables['author_id'] = $comment->getOwnerId();
$variables['new_indicator_timestamp'] = $comment->getChangedTime();
$variables['created'] = format_date($comment->getCreatedTime());
@@ -673,7 +673,7 @@ function template_preprocess_comment(&$variables) {
'#theme' => 'username',
'#account' => $account_parent,
];
- $variables['parent_author'] = drupal_render($username);
+ $variables['parent_author'] = \Drupal::service('renderer')->render($username);
$variables['parent_created'] = format_date($comment_parent->getCreatedTime());
// Avoid calling format_date() twice on the same timestamp.
if ($comment_parent->getChangedTime() == $comment_parent->getCreatedTime()) {
diff --git a/core/modules/comment/src/Plugin/views/field/EntityLink.php b/core/modules/comment/src/Plugin/views/field/EntityLink.php
index 03e6f6c..a2c6911 100644
--- a/core/modules/comment/src/Plugin/views/field/EntityLink.php
+++ b/core/modules/comment/src/Plugin/views/field/EntityLink.php
@@ -72,7 +72,7 @@ class EntityLink extends FieldPluginBase {
$entity = $this->getEntity($values);
// Only render the links, if they are defined.
- return !empty($this->build[$entity->id()]['links']['comment__comment']) ? drupal_render($this->build[$entity->id()]['links']['comment__comment']) : '';
+ return !empty($this->build[$entity->id()]['links']['comment__comment']) ? \Drupal::service('renderer')->render($this->build[$entity->id()]['links']['comment__comment']) : '';
}
}
diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
index fa24c3f..f88c049 100644
--- a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
+++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
@@ -70,7 +70,7 @@ class StatisticsLastCommentName extends FieldPluginBase {
'#theme' => 'username',
'#account' => $account,
];
- return drupal_render($username);
+ return \Drupal::service('renderer')->render($username);
}
else {
return $this->sanitizeValue($this->getValue($values));
diff --git a/core/modules/content_translation/content_translation.admin.inc b/core/modules/content_translation/content_translation.admin.inc
index f29a7e6..bf33ba0 100644
--- a/core/modules/content_translation/content_translation.admin.inc
+++ b/core/modules/content_translation/content_translation.admin.inc
@@ -209,7 +209,7 @@ function _content_translation_preprocess_language_content_settings_table(&$varia
$rows[] = [
'data' => [
[
- 'data' => drupal_render($field_element),
+ 'data' => \Drupal::service('renderer')->render($field_element),
'class' => ['translatable'],
],
[
@@ -243,7 +243,7 @@ function _content_translation_preprocess_language_content_settings_table(&$varia
$rows[] = [
'data' => [
[
- 'data' => drupal_render($column_element[$key]),
+ 'data' => \Drupal::service('renderer')->render($column_element[$key]),
'class' => ['translatable'],
],
[
diff --git a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
index 6bd5c01..09e4505 100644
--- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
@@ -138,7 +138,7 @@ class ContextualLinks extends FieldPluginBase {
'#type' => 'contextual_links_placeholder',
'#id' => _contextual_links_to_id($contextual_links),
];
- return drupal_render($element);
+ return \Drupal::service('renderer')->render($element);
}
else {
return '';
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 80ffbe9..a3b8868 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -73,7 +73,7 @@ function template_preprocess_file_widget_multiple(&$variables) {
// Render everything else together in a column, without the normal wrappers.
$widget['#theme_wrappers'] = [];
- $information = drupal_render($widget);
+ $information = \Drupal::service('renderer')->render($widget);
$display = '';
if ($element['#display_field']) {
unset($widget['display']['#title']);
diff --git a/core/modules/filter/src/Plugin/Filter/FilterCaption.php b/core/modules/filter/src/Plugin/Filter/FilterCaption.php
index 62c8395..03cddb7 100644
--- a/core/modules/filter/src/Plugin/Filter/FilterCaption.php
+++ b/core/modules/filter/src/Plugin/Filter/FilterCaption.php
@@ -64,7 +64,7 @@ class FilterCaption extends FilterBase {
'#caption' => $caption,
'#classes' => $classes,
];
- $altered_html = drupal_render($filter_caption);
+ $altered_html = \Drupal::service('renderer')->render($filter_caption);
// Load the altered HTML into a new DOMDocument and retrieve the element.
$updated_nodes = Html::load($altered_html)->getElementsByTagName('body')
diff --git a/core/modules/filter/src/Plugin/Filter/FilterHtml.php b/core/modules/filter/src/Plugin/Filter/FilterHtml.php
index 882bcc0..6e800c3 100644
--- a/core/modules/filter/src/Plugin/Filter/FilterHtml.php
+++ b/core/modules/filter/src/Plugin/Filter/FilterHtml.php
@@ -422,7 +422,7 @@ class FilterHtml extends FilterBase {
'#header' => $header,
'#rows' => $rows,
];
- $output .= drupal_render($table);
+ $output .= \Drupal::service('renderer')->render($table);
$output .= '<p>' . $this->t('Most unusual characters can be directly entered without any problems.') . '</p>';
$output .= '<p>' . $this->t('If you do encounter problems, try using HTML character entities. A common example looks like &amp;amp; for an ampersand &amp; character. For a full list of entities see HTML\'s <a href=":html-entities">entities</a> page. Some of the available characters include:', [':html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html']) . '</p>';
@@ -461,7 +461,7 @@ class FilterHtml extends FilterBase {
'#header' => $header,
'#rows' => $rows,
];
- $output .= drupal_render($table);
+ $output .= \Drupal::service('renderer')->render($table);
return $output;
}
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index c2de3c9..51472cf 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -460,12 +460,12 @@ function template_preprocess_forums(&$variables) {
'name' => $topic->getOwner()->getDisplayName(),
'created' => $topic->getCreatedTime(),
]];
- $variables['topics'][$id]->submitted = drupal_render($forum_submitted);
+ $variables['topics'][$id]->submitted = \Drupal::service('renderer')->render($forum_submitted);
$forum_submitted = [
'#theme' => 'forum_submitted',
'#topic' => isset($topic->last_reply) ? $topic->last_reply : NULL,
];
- $variables['topics'][$id]->last_reply = drupal_render($forum_submitted);
+ $variables['topics'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
$variables['topics'][$id]->new_text = '';
$variables['topics'][$id]->new_url = '';
@@ -569,7 +569,7 @@ function template_preprocess_forum_list(&$variables) {
$variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
}
$forum_submitted = ['#theme' => 'forum_submitted', '#topic' => $forum->last_post];
- $variables['forums'][$id]->last_reply = drupal_render($forum_submitted);
+ $variables['forums'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
}
$variables['pager'] = [
@@ -636,7 +636,7 @@ function template_preprocess_forum_submitted(&$variables) {
$variables['author'] = '';
if (isset($variables['topic']->uid)) {
$username = ['#theme' => 'username', '#account' => User::load($variables['topic']->uid)];
- $variables['author'] = drupal_render($username);
+ $variables['author'] = \Drupal::service('renderer')->render($username);
}
$variables['time'] = isset($variables['topic']->created) ? \Drupal::service('date.formatter')->formatTimeDiffSince($variables['topic']->created) : '';
}
diff --git a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
index f33dab2..3a8b22d 100644
--- a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
@@ -96,7 +96,7 @@ class HistoryUserTimestamp extends Node {
'#theme' => 'mark',
'#status' => $mark,
];
- return $this->renderLink(drupal_render($build), $values);
+ return $this->renderLink(\Drupal::service('renderer')->render($build), $values);
}
}
diff --git a/core/modules/image/src/Form/ImageStyleEditForm.php b/core/modules/image/src/Form/ImageStyleEditForm.php
index 574d914..1e24295 100644
--- a/core/modules/image/src/Form/ImageStyleEditForm.php
+++ b/core/modules/image/src/Form/ImageStyleEditForm.php
@@ -58,7 +58,7 @@ class ImageStyleEditForm extends ImageStyleFormBase {
$form['preview'] = [
'#type' => 'item',
'#title' => $this->t('Preview'),
- '#markup' => drupal_render($preview_arguments),
+ '#markup' => \Drupal::service('renderer')->render($preview_arguments),
// Render preview above parent elements.
'#weight' => -5,
];
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index 6c3bb5f..b96ee5a 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -173,7 +173,7 @@ function _node_mass_update_batch_finished($success, $results, $operations) {
'#theme' => 'item_list',
'#items' => $results,
];
- $message .= drupal_render($item_list);
+ $message .= \Drupal::service('renderer')->render($item_list);
drupal_set_message($message);
}
}
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 466f510..4e76edd 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -593,9 +593,9 @@ function template_preprocess_node(&$variables) {
$variables['node'] = $variables['elements']['#node'];
/** @var \Drupal\node\NodeInterface $node */
$node = $variables['node'];
- $variables['date'] = drupal_render($variables['elements']['created']);
+ $variables['date'] = \Drupal::service('renderer')->render($variables['elements']['created']);
unset($variables['elements']['created']);
- $variables['author_name'] = drupal_render($variables['elements']['uid']);
+ $variables['author_name'] = \Drupal::service('renderer')->render($variables['elements']['uid']);
unset($variables['elements']['uid']);
$variables['url'] = $node->url('canonical', [
diff --git a/core/modules/node/src/NodeListBuilder.php b/core/modules/node/src/NodeListBuilder.php
index 6266649..4dbdf27 100644
--- a/core/modules/node/src/NodeListBuilder.php
+++ b/core/modules/node/src/NodeListBuilder.php
@@ -110,7 +110,7 @@ class NodeListBuilder extends EntityListBuilder {
$row['title']['data'] = [
'#type' => 'link',
'#title' => $entity->label(),
- '#suffix' => ' ' . drupal_render($mark),
+ '#suffix' => ' ' . \Drupal::service('renderer')->render($mark),
'#url' => $uri,
];
$row['type'] = node_get_type_label($entity);
diff --git a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
index c008188..3709853 100644
--- a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
+++ b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
@@ -24,7 +24,7 @@ class UnpublishByKeywordNode extends ConfigurableActionBase {
public function execute($node = NULL) {
foreach ($this->configuration['keywords'] as $keyword) {
$elements = node_view(clone $node);
- if (strpos(drupal_render($elements), $keyword) !== FALSE || strpos($node->label(), $keyword) !== FALSE) {
+ if (strpos(\Drupal::service('renderer')->render($elements), $keyword) !== FALSE || strpos($node->label(), $keyword) !== FALSE) {
$node->setPublished(FALSE);
$node->save();
break;
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 0afcb09..8d43298 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -329,7 +329,7 @@ function rdf_preprocess_node(&$variables) {
'#theme' => 'rdf_metadata',
'#metadata' => [$date_attributes],
];
- $variables['metadata'] = drupal_render($rdf_metadata);
+ $variables['metadata'] = \Drupal::service('renderer')->render($rdf_metadata);
}
// Adds RDFa markup annotating the number of comments a node has.
@@ -534,7 +534,7 @@ function rdf_preprocess_comment(&$variables) {
if (!empty($variables['content']['comment_body']['#prefix'])) {
$rdf_metadata['#suffix'] = $variables['content']['comment_body']['#prefix'];
}
- $variables['content']['comment_body']['#prefix'] = drupal_render($rdf_metadata);
+ $variables['content']['comment_body']['#prefix'] = \Drupal::service('renderer')->render($rdf_metadata);
}
}
diff --git a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
index d18ff1c..899986a 100644
--- a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
+++ b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
@@ -81,7 +81,7 @@ class SearchExtraTypeSearch extends ConfigurableSearchPluginBase {
$pager = [
'#type' => 'pager',
];
- $output['suffix']['#markup'] = '</ol>' . drupal_render($pager);
+ $output['suffix']['#markup'] = '</ol>' . \Drupal::service('renderer')->render($pager);
return $output;
}
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index e5c67d3..83d7feb 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -445,20 +445,20 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
'#theme' => 'simpletest_result_summary',
'#label' => t($test_results[$class]['#name'] . ':'),
];
- array_unshift($items, drupal_render($class_test_result));
+ array_unshift($items, \Drupal::service('renderer')->render($class_test_result));
}
$context['message'] = t('Processed test @num of @max - %test.', ['%test' => $info['name'], '@num' => $max - $size, '@max' => $max]);
$overall_results = $test_results + [
'#theme' => 'simpletest_result_summary',
'#label' => t('Overall results:'),
];
- $context['message'] .= drupal_render($overall_results);
+ $context['message'] .= \Drupal::service('renderer')->render($overall_results);
$item_list = [
'#theme' => 'item_list',
'#items' => $items,
];
- $context['message'] .= drupal_render($item_list);
+ $context['message'] .= \Drupal::service('renderer')->render($item_list);
// Save working values for the next iteration.
$context['sandbox']['tests'] = $test_list;
diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module
index 2e6f164..6a701ab 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -153,7 +153,7 @@ function template_preprocess_theme_test_render_element(&$variables) {
* - element: An associative array containing the properties of the element.
*/
function theme_theme_test_render_element_children($variables) {
- return drupal_render($variables['element']);
+ return \Drupal::service('renderer')->render($variables['element']);
}
/**
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 0ccb24b..3811ee5 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -227,7 +227,7 @@ class OverviewTerms extends FormBase {
];
}
$form['terms'][$key]['term'] = [
- '#prefix' => !empty($indentation) ? drupal_render($indentation) : '',
+ '#prefix' => !empty($indentation) ? \Drupal::service('renderer')->render($indentation) : '',
'#type' => 'link',
'#title' => $term->getName(),
'#url' => $term->urlInfo(),
diff --git a/core/modules/update/src/Form/UpdateManagerUpdate.php b/core/modules/update/src/Form/UpdateManagerUpdate.php
index 62572d6..60f506a 100644
--- a/core/modules/update/src/Form/UpdateManagerUpdate.php
+++ b/core/modules/update/src/Form/UpdateManagerUpdate.php
@@ -69,7 +69,7 @@ class UpdateManagerUpdate extends FormBase {
'#last' => $this->state->get('update.last_check') ?: 0,
];
$form['last_check'] = [
- '#markup' => drupal_render($last_markup),
+ '#markup' => \Drupal::service('renderer')->render($last_markup),
];
if (!_update_manager_check_backends($form, 'update')) {
diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc
index d9067f4..399694f 100644
--- a/core/modules/update/update.manager.inc
+++ b/core/modules/update/update.manager.inc
@@ -53,7 +53,7 @@ function update_manager_download_batch_finished($success, $results) {
'#title' => t('Downloading updates failed:'),
'#items' => $results['errors'],
];
- drupal_set_message(drupal_render($item_list), 'error');
+ drupal_set_message(\Drupal::service('renderer')->render($item_list), 'error');
}
elseif ($success) {
drupal_set_message(t('Updates downloaded successfully.'));
diff --git a/core/modules/views/src/Analyzer.php b/core/modules/views/src/Analyzer.php
index a5de193..a6a8d56 100644
--- a/core/modules/views/src/Analyzer.php
+++ b/core/modules/views/src/Analyzer.php
@@ -77,7 +77,7 @@ class Analyzer {
'#theme' => 'item_list',
'#items' => $messages,
];
- $message = drupal_render($item_list);
+ $message = \Drupal::service('renderer')->render($item_list);
}
elseif ($messages) {
$message = array_shift($messages);
diff --git a/core/modules/views/src/Plugin/views/area/Result.php b/core/modules/views/src/Plugin/views/area/Result.php
index d2f1b01..2bbd23b 100644
--- a/core/modules/views/src/Plugin/views/area/Result.php
+++ b/core/modules/views/src/Plugin/views/area/Result.php
@@ -47,7 +47,7 @@ class Result extends AreaPluginBase {
'@page_count -- the total page count',
],
];
- $list = drupal_render($item_list);
+ $list = \Drupal::service('renderer')->render($item_list);
$form['content'] = [
'#title' => $this->t('Display'),
'#type' => 'textarea',
diff --git a/core/modules/views/src/Plugin/views/field/PrerenderList.php b/core/modules/views/src/Plugin/views/field/PrerenderList.php
index f851cbb..f27973e 100644
--- a/core/modules/views/src/Plugin/views/field/PrerenderList.php
+++ b/core/modules/views/src/Plugin/views/field/PrerenderList.php
@@ -90,7 +90,7 @@ abstract class PrerenderList extends FieldPluginBase implements MultiItemsFieldH
'#list_type' => $this->options['type'],
];
}
- return drupal_render($render);
+ return \Drupal::service('renderer')->render($render);
}
}
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index f6b4f79..453c90b 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -614,7 +614,7 @@ function views_pre_render_views_form_views_form($element) {
$row_id = $substitution['row_id'];
$search[] = $substitution['placeholder'];
- $replace[] = isset($element[$field_name][$row_id]) ? drupal_render($element[$field_name][$row_id]) : '';
+ $replace[] = isset($element[$field_name][$row_id]) ? \Drupal::service('renderer')->render($element[$field_name][$row_id]) : '';
}
// Add in substitutions from hook_views_form_substitutions().
$substitutions = \Drupal::moduleHandler()->invokeAll('views_form_substitutions');
@@ -628,7 +628,7 @@ function views_pre_render_views_form_views_form($element) {
}
// Apply substitutions to the rendered output.
- $output = str_replace($search, $replace, drupal_render($element['output']));
+ $output = str_replace($search, $replace, \Drupal::service('renderer')->render($element['output']));
$element['output'] = ['#markup' => ViewsRenderPipelineMarkup::create($output)];
return $element;
diff --git a/core/modules/views_ui/src/Form/BreakLockForm.php b/core/modules/views_ui/src/Form/BreakLockForm.php
index 94a626f..b73e618 100644
--- a/core/modules/views_ui/src/Form/BreakLockForm.php
+++ b/core/modules/views_ui/src/Form/BreakLockForm.php
@@ -74,7 +74,7 @@ class BreakLockForm extends EntityConfirmFormBase {
'#theme' => 'username',
'#account' => $account,
];
- return $this->t('By breaking this lock, any unsaved changes made by @user will be lost.', ['@user' => drupal_render($username)]);
+ return $this->t('By breaking this lock, any unsaved changes made by @user will be lost.', ['@user' => \Drupal::service('renderer')->render($username)]);
}
/**
diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php
index 67d1229..fe3d86f 100644
--- a/core/modules/views_ui/src/ViewEditForm.php
+++ b/core/modules/views_ui/src/ViewEditForm.php
@@ -129,7 +129,7 @@ class ViewEditForm extends ViewFormBase {
'#account' => $this->entityManager->getStorage('user')->load($view->lock->owner),
];
$lock_message_substitutions = [
- '@user' => drupal_render($username),
+ '@user' => \Drupal::service('renderer')->render($username),
'@age' => $this->dateFormatter->formatTimeDiffSince($view->lock->updated),
':url' => $view->url('break-lock-form'),
];
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
index 3e1ee40..0666367 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
@@ -46,7 +46,7 @@ class RendererBubblingTest extends RendererTestBase {
$element = [
'#type' => 'container',
'#cache' => [
- 'keys' => ['simpletest', 'drupal_render', 'children_attached'],
+ 'keys' => ['simpletest', 'renderer', 'children_attached'],
],
'#attached' => ['library' => ['test/parent']],
'#title' => 'Parent',
@@ -68,7 +68,7 @@ class RendererBubblingTest extends RendererTestBase {
// Load the element from cache and verify the presence of the #attached
// JavaScript.
- $element = ['#cache' => ['keys' => ['simpletest', 'drupal_render', 'children_attached']]];
+ $element = ['#cache' => ['keys' => ['simpletest', 'renderer', 'children_attached']]];
$this->assertTrue(strlen($this->renderer->renderRoot($element)) > 0, 'The element was retrieved from cache.');
$this->assertEquals($element['#attached']['library'], $expected_libraries, 'The element, child and subchild #attached libraries are included.');
}
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index 00426c2..a92c363 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -996,7 +996,7 @@ HTML;
$this->assertSame($element['#attached']['drupalSettings'], $expected_js_settings, '#attached is modified; both the original JavaScript setting and the ones added by each placeholder #lazy_builder callback exist.');
// GET request: validate cached data.
- $cached_element = $this->memoryCache->get('simpletest:drupal_render:children_placeholders')->data;
+ $cached_element = $this->memoryCache->get('simpletest:renderer:children_placeholders')->data;
$expected_element = [
'#attached' => [
'drupalSettings' => [
@@ -1066,7 +1066,7 @@ HTML;
$test_element = [
'#type' => 'details',
'#cache' => [
- 'keys' => ['simpletest', 'drupal_render', 'children_placeholders'],
+ 'keys' => ['simpletest', 'renderer', 'children_placeholders'],
],
'#title' => 'Parent',
'#attached' => [