View using the Search Results row plugin doesn't display anything

Created on 7 April 2016, about 9 years ago
Updated 5 April 2023, over 2 years ago

Problem/Motivation

There is a Views row plugin called "Search Results" (core/modules/search/src/Plugin/views/row/SearchRow.php). This was apparently imported from a non-working row plugin in the Drupal 7 contrib Views module. However, as far as we can tell:

a) It didn't work in Drupal 7. Here's the code from there:

function search_views_plugins() {
  return;
  // DISABLED. This currently doesn't work.
  return array(
    'module' => 'views', // This just tells our themes are elsewhere.
    'row' => array(
      'search' => array(
        'title' => t('Search'),
        'help' => t('Display the results with standard search view.'),
...

b) Although it was imported into Drupal 8 initially as core/modules/views/lib/Views/search/Plugin/views/row/View.php (I think) early in the port to Views, it was never made to work and never had any tests.

c) It still has no tests and doesn't work. However, it appears in the UI when you are creating a view of nodes, as a row option. It causes the view to display nothing. See "Original issue -- Steps to reproduce" section below for steps to reproduce.

d) We do not need this plugin. If you want to make a view of search results, you can use the node Teaser view or the Fields row plugin.

e) We don't actually know what it was supposed to display.

Proposed resolution

Remove this non-working, confusing plugin, along with its config schema.

Remaining tasks

Make a patch and commit it.

User interface changes

The non-working plugin for search results rows in Views will no longer appear in the UI.

API changes

The non-working plugin code will no longer be in Core.

Data model changes

The schema for the non-working plugin will no longer be in Core.

Original issue -- Steps to reproduce

  1. Simplytest.me with devel (for devel generate) and core
  2. Generate 50 basic pages using devel generate defaults
  3. Run cron via status page to index content
  4. Generate simple page view as unformatted list displaying search results (Format>Show Search Results)
  5. Add an exposed filter on search term Apply

Expected results

Display of search results (or something) that include the term, in the case of my test there should be one search result.

Actual results

  • Nothing is displayed.
  • Selecting a term that is common shows pager with no row output.
  • Checking dblog shows 2 entries:
    • Theme hook not found.
    • Notice: Undefined index: theme in Drupal\views\Plugin\views\PluginBase->themeFunctions() (line 296 of /home/r0k6k/www/core/modules/views/src/Plugin/views/PluginBase.php).
  • Switching the display to be content (Format>Content) displays the content for the result.

Export of configuration is attached.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
SearchΒ  β†’

Last updated 3 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡ΊπŸ‡ΈUnited States greggmarshall Aurora/Denver, Colorado

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand danielveza Brisbane, AU

    Confirming that in 10.1 the plugin still doesn't do anything and after the patch any page with the view is broken.

    I've started on the update hook but interested in hearing thoughts. I was having a hard time finding a way to set the display to it's default value. I wonder if we should just set the display options to [] whenever the displays row plugin is this one?

Production build 0.71.5 2024