[3.11, CustomCert] enabling custom fields on 'show user identity' causes db error

[3.11, CustomCert] enabling custom fields on 'show user identity' causes db error

by tim st.clair -
Number of replies: 0
Picture of Plugin developers

Steps to recreate:

1. Create a custom profile field of any type

2. Under Administration > Users > Permissions > User Policies > Show User Identity : select one of the custom profile fields

3. Try to view a certificate - error.

With debug enabled, it is shown that the SQL doesn't include the extra joins required to look up user profile fields, even though they are referenced in the select.

Debug info: Unknown column 'uf1d_1.data' in 'field list'

SELECT u.id, u.picture, u.firstname, u.lastname, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.imagealt, u.email, u.department, uf1d_1.data AS profile_field_cpdcme, ci.id as issueid, ci.code, ci.timecreated
FROM mdl_user u
INNER JOIN mdl_customcert_issues ci
ON u.id = ci.userid
WHERE u.deleted = 0
AND ci.customcertid = ?
AND NOT u.id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
ORDER BY CONCAT(firstname, ' ', lastname) LIMIT 0, 50


Average of ratings: -