From b3d7ed3e8e09c9e3180cd1bb1baad5f2d256d625 Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 5 Sep 2012 12:10:54 -0700 Subject: [PATCH] Respect users with duplicate real names in commit parser Test Plan: $parser->resolveUserPHID('Lei Zhao'); $parser->resolveUserPHID('Jakub Vrana'); Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3437 --- .../PhabricatorRepositoryCommitMessageDetailParser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/applications/repository/parser/PhabricatorRepositoryCommitMessageDetailParser.php b/src/applications/repository/parser/PhabricatorRepositoryCommitMessageDetailParser.php index 34d4b230d8..40074e0d95 100644 --- a/src/applications/repository/parser/PhabricatorRepositoryCommitMessageDetailParser.php +++ b/src/applications/repository/parser/PhabricatorRepositoryCommitMessageDetailParser.php @@ -97,11 +97,11 @@ abstract class PhabricatorRepositoryCommitMessageDetailParser { private function findUserByRealName($real_name) { // Note, real names are not guaranteed unique, which is why we do it this // way. - $by_realname = id(new PhabricatorUser())->loadOneWhere( - 'realName = %s LIMIT 1', + $by_realname = id(new PhabricatorUser())->loadAllWhere( + 'realName = %s', $real_name); - if ($by_realname) { - return $by_realname->getPHID(); + if (count($by_realname) == 1) { + return reset($by_realname)->getPHID(); } return null; }