From: Coleman Watts Date: Sun, 22 Nov 2015 01:43:03 +0000 (-0500) Subject: synchronizeUsers minor fixups X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2eb3dae216c21547f8acb1d244b5465f13a070a3;p=civicrm-core.git synchronizeUsers minor fixups --- diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 765ad3ebe9..a9322f6942 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -797,28 +797,23 @@ AND u.status = 1 if (PHP_SAPI != 'cli') { set_time_limit(300); } - $rows = array(); $id = 'uid'; $mail = 'mail'; $name = 'name'; $result = db_query("SELECT uid, mail, name FROM {users} where mail != ''"); - while ($row = $result->fetchAssoc()) { - $rows[] = $row; - } - $user = new StdClass(); $uf = $config->userFramework; $contactCount = 0; $contactCreated = 0; $contactMatching = 0; - foreach ($rows as $row) { - $user->$id = $row[$id]; - $user->$mail = $row[$mail]; - $user->$name = $row[$name]; + foreach ($result as $row) { + $user->$id = $row->$id; + $user->$mail = $row->$mail; + $user->$name = $row->$name; $contactCount++; - if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($user, $row[$id], $row[$mail], $uf, 1, 'Individual', TRUE)) { + if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($user, $row->$id, $row->$mail, $uf, 1, 'Individual', TRUE)) { $contactCreated++; } else {