mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
LdapConnection: Fix that fetchColumn() returns results unordered
This commit is contained in:
parent
ca112af9ad
commit
6ff15acc1b
@ -374,12 +374,13 @@ class LdapConnection implements Selectable
|
|||||||
$fields = $query->getColumns();
|
$fields = $query->getColumns();
|
||||||
}
|
}
|
||||||
|
|
||||||
$column = current($fields);
|
if (empty($fields)) {
|
||||||
if (! $column) {
|
|
||||||
throw new ProgrammingError('You must request at least one attribute when fetching a single column');
|
throw new ProgrammingError('You must request at least one attribute when fetching a single column');
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = $this->fetchAll($query, array($column));
|
$alias = key($fields);
|
||||||
|
$results = $this->fetchAll($query, array($alias => current($fields)));
|
||||||
|
$column = is_int($alias) ? current($fields) : $alias;
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
if (isset($row->$column)) {
|
if (isset($row->$column)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user