Problem/Motivation
The module always expects a $response['hits'] raw response in \Drupal\elasticsearch_search_api\Search\ElasticSearchResultParser::parse(...)
In case ES server is down or in an error state and it throws an error response rendering fails ugly...
Steps to reproduce
Remove your index on a running setup or simulate another error response from your ES server
Proposed resolution
Make the response parsing more robust and show proper notification without crashing with a WSOD.
Remaining tasks
Fix the code mentioned above and search for other related parsing elsewhere.
User interface changes
none
API changes
none
Data model changes
none
Comments
Comment #2
lorenzs commentedComment #4
lorenzs commentedAdded error handling in above MR. ES and backend services / repositories keep throwing errors as-is, the (Base) Controller will handle them (in search/filter/suggest) and render proper error notification instead of WSOD.
Comment #5
lorenzs commentedComment #6
matthew.hallsworth commentedI'm going to setup a testbed to test this patch today and get back to you @lorenzs
Stay tuned :)
Comment #8
lorenzs commentedAfter feedback on MR tested in 2 different sites implementing the module. Exceptions result in proper feedback and if all is good everythings works as before (tested with search, filter and suggest - with/without ajax).
Comment #9
matthew.hallsworth commented@lorenzs I've tested this in two local dev setup, with normal setup and your patch
Both scenarios when removing index returns proper feedback and all works as expected. Happy to push this on also
Comment #10
robindh commentedThanks for the feedback @matthew.hallsworth.dpc
I've tested this on my local umami demo setup after merge request changes - still works as expected. RTBC +1
Comment #12
robindh commentedComment #13
lorenzs commented