esmero / strawberryfield

A Field of strawberries
GNU Lesser General Public License v3.0
10 stars 5 forks source link

Call to undefined method Drupal\search_api_db in StrawberryfieldUtilityService.php #312

Closed roromedia closed 5 months ago

roromedia commented 5 months ago

Error: Call to undefined method Drupal\search_api_db\Plugin\search_api\backend\Database::getSolrFieldNames() in Drupal\strawberryfield\StrawberryfieldUtilityService->getCountByProcessorInSolr() (line 348 of /var/www/html/web/modules/contrib/strawberryfield/src/StrawberryfieldUtilityService.php)

This error is thrown at IABookReader instances through the StrawberryPagedFormatter.php in Line 780 - as it is an AJAX-call it fails silently with an error 500 in the XHR-panel of the inspector and the book reader then stays blank. After a refresh of the page the bookreader gets loaded most of the time.

This happens most likely because the code makes the assumption that all indexes are based on Solr and all methods therefore are available. Our search_api_db-based index then fails as the call to the method getCountByProcessorInSolr() is undefined in the foreach()-loop.

DiegoPino commented 5 months ago

@roromedia can you please check https://github.com/esmero/strawberryfield/pull/309/commits/8adaa803b0fd5679baa93b2785b7ab8cfccb65a2 or directly fetch ISSUE-308 and merge over yours? The issue was me. My check was returning sooner ...

DiegoPino commented 5 months ago

Solved via https://github.com/esmero/strawberryfield/commit/8adaa803b0fd5679baa93b2785b7ab8cfccb65a2