Skip to content

Commit 30749af

Browse files
lachezarvalchevnignatov
authored andcommitted
Issue #2617078 by lachezar.valchev: Fixed issue causing clusters with authentication to stop working when the elasticsearch_connector_devel module is enabled.
1 parent 1fda76d commit 30749af

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

elasticsearch_connector.admin.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ function elasticsearch_connector_edit_cluster_form_info($cluster) {
607607
array('data' => t('Number of nodes')),
608608
);
609609

610-
if (isset($cluster_info['state'])) {
610+
if (isset($cluster_info['state']) && !isset($cluster_info['state']['error'])) {
611611
$rows = array(
612612
array(
613613
$cluster_info['health']['cluster_name'],

modules/elasticsearch_connector_devel/includes/GuzzleConnectionDebugging.inc

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class GuzzleConnectionDebug extends AbstractConnection implements ConnectionInte
4646
$guzzleOptions = array();
4747
$guzzleOptions['curl.options']['body_as_string'] = true;
4848

49-
if (isset($connectionParams['connectionParams']['auth']) === true) {
50-
$connectionParams['request.options']['auth'] = $connectionParams['connectionParams']['auth'];
49+
if (isset($connectionParams['auth']) === true) {
50+
$guzzleOptions['request.options']['auth'] = $connectionParams['auth'];
5151
}
5252

5353
if (!isset($connectionParams['guzzleOptions'])) {
@@ -58,12 +58,12 @@ class GuzzleConnectionDebug extends AbstractConnection implements ConnectionInte
5858
$this->guzzle = new \Guzzle\Http\Client(null,$guzzleOptions);
5959
}
6060

61-
if (isset($port) !== true) {
62-
$port = 9200;
61+
if (isset($hostDetails['port']) !== true) {
62+
$hostDetails['port'] = 9200;
6363
}
6464

65-
if (isset($connectionParams['connectionParams'])) {
66-
$this->connectionOpts = $connectionParams['connectionParams'];
65+
if (isset($connectionParams)) {
66+
$this->connectionOpts = $connectionParams;
6767
}
6868

6969
return parent::__construct($hostDetails, $connectionParams, $log, $trace);
@@ -322,4 +322,4 @@ class GuzzleConnectionDebug extends AbstractConnection implements ConnectionInte
322322
);
323323
}
324324

325-
}
325+
}

0 commit comments

Comments
 (0)