Commit 6bfe61e1 authored by Johan Cwiklinski's avatar Johan Cwiklinski

We want only one result here; fixes #3874

parent 1338a21b
......@@ -243,6 +243,7 @@ class CommonDBTM extends CommonGLPI {
/**
* Generator to browse object from an iterator
* @see http://php.net/manual/en/language.generators.syntax.php
*
* @since 9.2
*
......
......@@ -74,8 +74,9 @@ class SlaLevel_Ticket extends CommonDBTM {
],
'LIMIT' => 1
]);
if (count($iterator)) {
return $this->getFromIter($iterator);
if (count($iterator) == 1) {
$row = $iterator->next();
return $this->getFromDB($row['id']);
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment