From 2eb3dae216c21547f8acb1d244b5465f13a070a3 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 21 Nov 2015 20:43:03 -0500 Subject: [PATCH] synchronizeUsers minor fixups --- CRM/Utils/System/Drupal.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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 { -- 2.25.1