diff --git a/module/finc/src/finc/Controller/PdaTrait.php b/module/finc/src/finc/Controller/PdaTrait.php index 61fc4085dfa1d55ed00cde3e37ab43971fabb16e..9e8e71a9a4ffeff38a2d0e33321f9a173ee6baae 100644 --- a/module/finc/src/finc/Controller/PdaTrait.php +++ b/module/finc/src/finc/Controller/PdaTrait.php @@ -89,15 +89,20 @@ trait PdaTrait // User is authorized to use PDA // Start collecting params for PDA + $catalog = $this->getILS(); + $profile = $catalog->getMyProfile($patron); + + // prefer profile data from ILS over user data from db $params = [ 'username' => trim($user->cat_username), - 'email' => trim($user->email), - 'firstname' => trim($user->firstname), - 'lastname' => trim($user->lastname) + 'email' => isset($profile['email']) + ? $profile['email'] : trim($user->email), + 'firstname' => isset($profile['firstname']) + ? $profile['firstname'] : trim($user->firstname), + 'lastname' => isset($profile['lastname']) + ? $profile['lastname'] : trim($user->lastname) ]; - $catalog = $this->getILS(); - $profile = $catalog->getMyProfile($patron); if (isset($profile['group'])) { $params['group'] = $profile['group']; }