Skip to content

Commit

Permalink
Fix iterator usage
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Aug 9, 2023
1 parent 67b50ea commit 3172bb0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function plugin_fields_rule_matched($params = [])
]
]);
if (count($iterator) > 0) {
$data = $iterator->next();
$data = $iterator->current();

//retrieve computer
$agents_id = $params['input']['plugin_fusioninventory_agents_id'];
Expand Down
2 changes: 1 addition & 1 deletion inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ public static function validateValues($data, $itemtype, $massiveaction)
],
]);

$db_result = $iterator->next();
$db_result = $iterator->current();
if (isset($db_result['plugin_fields_' . $name . 'dropdowns_id'])) {
$value = $db_result['plugin_fields_' . $name . 'dropdowns_id'];
} else if (isset($db_result[$name])) {
Expand Down
2 changes: 1 addition & 1 deletion inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public function getNextRanking()
]);

if (count($iterator) > 0) {
$data = $iterator->next();
$data = $iterator->current();
return $data["rank"] + 1;
}
return 0;
Expand Down

0 comments on commit 3172bb0

Please sign in to comment.