Skip to content

Commit

Permalink
Fix iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
xacobofg committed May 10, 2022
1 parent d52dd0e commit 6235a53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inc/apirest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ protected function basicInfo($params=[]){
'is_uploadable'=>1
]
];
$iterator=$DB->request($sql);
while ($data = $iterator->next()) {
$iterator = $DB->request($sql);
foreach ($iterator as $data) {
$info['documenttype'][] = $data;
}

Expand Down Expand Up @@ -531,7 +531,7 @@ protected function itilCategory($params=[]) {
$query['WHERE']['is_request'] = $params['is_request'];
}
if ($result = $DB->request($query)) {
while ($data = $result->next()) {
foreach ($result as $data) {
$info[] = $data;
}
}
Expand All @@ -558,7 +558,7 @@ protected function location($params=[]) {
'WHERE' => getEntitiesRestrictCriteria('glpi_locations', '', $_SESSION['glpiactive_entity'], $item->maybeRecursive()),
];
if ($result = $DB->request($query)) {
while ($data = $result->next()) {
foreach ($result as $data) {
$info[] = $data;
}
}
Expand Down

0 comments on commit 6235a53

Please sign in to comment.