Array to string conversion on $doc_fields['hash']

Created on 11 November 2022, about 2 years ago
Updated 7 September 2023, over 1 year ago

Setup

  • Solr version:
  • 8

  • Drupal Core version:
  • 9.4.7

  • Search API version:
  • 1.26

  • Search API Solr version:
  • 4.2.9

  • Configured Solr Connector:

Issue

I am receiving this warning message
Warning: Array to string conversion in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->extractResults() (line 2922 of modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php).
It seems that it is because $doc_fields['hash'] can sometimes be an array.

Like the solution in this issue https://www.drupal.org/project/search_api_solr/issues/3281703 🐛 TypeError: Illegal offset type in isset or empty in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->getLanguageSpecificSolrFieldNames() (line 2304 of modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend Fixed I have added a patch that checks if this is as an array and then get the current index of the array. The patch attached may only apply if the patch from the MR in 3281703 is also applied.

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom mjmorley

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.

Production build 0.71.5 2024