The call to apachesolr_get_solr() in the hook_views_data() implementation needs to be wrapped in a try-catch block, since the docs for apachesolr_get_solr() specify that it will throw an exception if something goes wrong. Patch coming in a moment.

Comments

becw’s picture

Title: Call to apachesolr_get_solr() needs to be wrapped in try-catch » Call to apachesolr_get_solr() needs to be wrapped in try-catch (patch)
Status: Active » Needs review
StatusFileSize
new763 bytes

Here's the patch.

becw’s picture

Priority: Normal » Critical

apachesolr_views needs to fail gracefully even if apachesolr is misconfigured.

becw’s picture

More details: when apachesolr_views is enabled but an apachesolr environment is unavailable (either because one has not been configured or because Solr is unavailable), apachesolr_views fails to catch an exception during cache clears. This has the side effect of preventing the menu from rebuilding.

Exception: "0" Status: Request failed: Connection refused in DrupalApacheSolrService->checkResponse() (line 360 of /shared/vash/sandboxes/white/apachesolr/www/sites/default/modules/apachesolr/Drupal_Apache_Solr_Service.php).

The patch from #1 fixes this issue.

Refineo’s picture

I confirm the patch from #1 solved the issue for me as well.

dstuart’s picture

Assigned: Unassigned » dstuart
Status: Needs review » Fixed

Have added to 7.x dev. Should be present when picked up by the next ci cycle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.