Skip to content

Commit 9df71ff

Browse files
authored
Merge pull request #51 from AdrienClairembault/fix/next
Replace outdated $iterator->next() calls
2 parents ec9bdbe + 7028594 commit 9df71ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inc/ticket.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static function getLastLinkedUserByType($type, $target) {
138138
$result = $DB->request($last);
139139

140140
$querylast = '';
141-
if ($data = $result->next()) {
141+
if ($data = $result->current()) {
142142
$object = new $target->obj->userlinkclass();
143143
if ($object->getFromDB($data['lastid'])) {
144144
$querylast = " AND `$userlinktable`.`users_id` = '".$object->fields['users_id']."'";
@@ -219,7 +219,7 @@ static function getLastLinkedGroupByType($type, $target, $supervisor=0) {
219219
'WHERE' => [$grouplinktable.'.'.$fkfield => $target->obj->fields["id"],
220220
$grouplinktable.'.type' => $type]];
221221

222-
if ($data = $result->next()) {
222+
if ($data = $result->current()) {
223223
$object = new $target->obj->grouplinkclass();
224224
if ($object->getFromDB($data['lastid'])) {
225225
$query['WHERE']['groups_id'] = $object->fields['groups_id'];
@@ -247,7 +247,7 @@ static function getLastSupplierAddress($target) {
247247
'WHERE' => [$supplierlinktable.'.'.$fkfield => $target->obj->fields["id"]]];
248248

249249
$result = $DB->request($last);
250-
$data = $result->next();
250+
$data = $result->current();
251251

252252
$query = ['SELECT' => 'glpi_suppliers.email AS email',
253253
'DISTINCT' => true,

0 commit comments

Comments
 (0)