diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php index 3250990..5fbc5ce 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php @@ -118,8 +118,8 @@ public function viewElements(FieldItemListInterface $items) { if ($status != COMMENT_HIDDEN && empty($entity->in_preview) && // Comments are added to the search results and search index by // comment_node_update_index() instead of by this formatter, so don't - // return anything if the view mode is search_index or search_result. - !in_array($this->viewMode, array('search_result', 'search_index'))) { + // return anything if the view mode is search_index. + $this->viewMode != 'search_index') { $comment_settings = $this->getFieldSettings(); // Only attempt to render comments if the entity has visible comments. diff --git a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php index 2c69b9f..fdbeefe 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php @@ -238,7 +238,7 @@ public function execute() { // Render the node. /** @var \Drupal\node\NodeInterface $node */ $node = $node_storage->load($item->sid)->getTranslation($item->langcode); - $build = $node_render->view($node, 'search_result', $item->langcode); + $build = $node_render->view($node, 'search_index', $item->langcode); unset($build['#theme']); $node->rendered = drupal_render($build); diff --git a/core/modules/search/config/entity.view_mode.node.search_result.yml b/core/modules/search/config/entity.view_mode.node.search_result.yml deleted file mode 100644 index 178a11c..0000000 --- a/core/modules/search/config/entity.view_mode.node.search_result.yml +++ /dev/null @@ -1,5 +0,0 @@ -id: node.search_result -label: 'Search result' -status: false -cache: true -targetEntityType: node