When setting up new environments, it's often useful to first install Drupal, and then configure Elasticsearch Helper. Currently, the installation from an existing codebase with existing configuration will fail if Elasticsearch is not available (or improperly configured for the current environment). The same thing happens if someone wants to uninstall a module that define an Elasticsearch Helper plugin, if the Elasticsearch server is not available the module can't be uninstalled.
The attached patch simply catches the NoNodesAvailableException in the the elasticsearch_helper_modules_installed and elasticsearch_helper_module_preuninstall hooks.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | interdiff_1-2.txt | 1.45 KB | hkirsman |
| #2 | elasticsearch_helper-prevent-installation-fatal-errors-3038485-2.patch | 4.84 KB | hkirsman |
| prevent-installation-fatal-errors.patch | 3.18 KB | floretan |
Comments
Comment #2
hkirsman commentedAdded simple test for this. Needed node dependency to be added.
Comment #3
hkirsman commentedWondering if the test function should be empty so we could use automated testing here https://www.drupal.org/node/2720203/qa I mean there's no ES in drupal.org testing environment but the test would work if we don't check for the "Connected to Elasticsearch" string.
Comment #4
tormitekla_nodeinnamespace Drupal\Tests\tekla_node\Functional;should probably be changed to something more neutral.