MDL-46229 badges: Fix missing additional names fields

Signed-off-by: Yuliya Bozhko <[email protected]>
This commit is contained in:
Yuliya Bozhko
2014-07-03 09:33:27 +12:00
parent 83d08fcc21
commit 3571cd46d2
+3 -2
View File
@@ -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;