diff --git a/php/libraries/User.class.inc b/php/libraries/User.class.inc index f41bbea209f..46a5a3dba8b 100644 --- a/php/libraries/User.class.inc +++ b/php/libraries/User.class.inc @@ -122,12 +122,12 @@ class User extends UserPermissions implements epr.pending_approval FROM examiners e JOIN examiners_psc_rel epr ON (e.examinerID=epr.examinerID) - WHERE e.full_name=:fn + WHERE e.userID=:uid AND (epr.active='Y' OR (epr.active='N' AND epr.pending_approval='Y') )", [ - "fn" => $row['Real_name'], + "uid" => $row['ID'], ] ); diff --git a/test/unittests/UserTest.php b/test/unittests/UserTest.php index 1a57b15ad1c..5101543117a 100644 --- a/test/unittests/UserTest.php +++ b/test/unittests/UserTest.php @@ -105,6 +105,7 @@ class UserTest extends TestCase * @var array */ private $_examinerInfo = [0 => ['full_name' => 'John Doe', + 'userID' => '1', 'examinerID' => 1, 'radiologist' => 1 ]