MDL-46229 badges: Fix missing additional names fields
Signed-off-by: Yuliya Bozhko <[email protected]>
This commit is contained in:
+3
-2
@@ -970,9 +970,10 @@ class external_badge implements renderable {
|
||||
global $DB;
|
||||
// At this point a user has connected a backpack. So, we are going to get
|
||||
// their backpack email rather than their account email.
|
||||
$user = $DB->get_record_sql('SELECT u.lastname, u.firstname, b.email
|
||||
$namefields = get_all_user_name_fields(true, 'u');
|
||||
$user = $DB->get_record_sql("SELECT {$namefields}, b.email
|
||||
FROM {user} u INNER JOIN {badge_backpack} b ON u.id = b.userid
|
||||
WHERE userid = :userid', array('userid' => $recipient), IGNORE_MISSING);
|
||||
WHERE userid = :userid", array('userid' => $recipient), IGNORE_MISSING);
|
||||
|
||||
$this->issued = $badge;
|
||||
$this->recipient = $user;
|
||||
|
||||
Reference in New Issue
Block a user