Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(api): fix php warning in realtime host api #6174

Merged
merged 2 commits into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions www/api/class/centreon_realtime_hosts.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ public function getHostState()
$query .= " AND h.enabled = 1 ";

if (
in_array($this->sortType, explode(',', $this->arguments['fields'])) ||
is_null($this->arguments['fields'])
!isset($this->arguments['fields']) ||
is_null($this->arguments['fields']) ||
in_array($this->sortType, explode(',', $this->arguments['fields']))
) {
$q = 'ASC';
if (isset($this->order) && strtoupper($this->order) === 'DESC') {
Expand Down
2 changes: 1 addition & 1 deletion www/class/centreonHostgroups.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function getHostsByHostgroupName($hgName)
$hostList[] = array(
'host' => $elem['host_name'],
'host_id' => $elem['host_id'],
'hg_name' => $elem[$hgName]
'hg_name' => $hgName
);
}

Expand Down
2 changes: 1 addition & 1 deletion www/class/centreonInstance.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function getHostsByInstance($instanceName)
while ($elem = $result->fetchrow()) {
$instanceList[] = array(
'host' => $elem['host_name'],
'name' => $elem['instance_name']
'name' => $instanceName
);
}

Expand Down
2 changes: 1 addition & 1 deletion www/class/centreonServicegroups.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function getServicesByServicegroupName($sgName)
'service' => $elem['service_description'],
'service_id' => $elem['service_id'],
'host' => $elem['host_name'],
'sg_name' => $elem[$sgName]
'sg_name' => $sgName
);
}

Expand Down