Undefined index: search_results if search index is empty

Created on 9 December 2021, over 3 years ago
Updated 23 November 2024, 5 months ago

If search index is empty then after visiting views page with REST Fasets display the notice appeared while viewing other page: Undefined index: search_results in Drupal\facets_rest\Plugin\views\style\FacetsSerializer->render() (line 130 of modules/contrib/facets/modules/facets_rest/src/Plugin/views/style/FacetsSerializer.php).

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇷🇺Russia a.sinitsa

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.

  • 🇧🇪Belgium p-neyens

    If we specify to also pass the facets data then it seems better to also provide the serach_results as an empty array.

    Result:

    • If we don't have the ‘show_facets’ setting enabled, we get back an empty array and when results are available a filled array.
    • If we do have the ‘show_facets’ setting enabled, we get back an array that also contains the search_results so it is consistent.


Production build 0.71.5 2024