-
Bug
-
Resolution: Fixed
-
Minor
-
3.11
-
MOODLE_311_STABLE
-
MOODLE_311_STABLE
-
MDL-71832-master -
To reproduce:
- If you don't already have one, add a custom user profile field (admin / Users / Accounts / User profile fields) of type 'text input', max length 100, short name 'testid'
- Set this field to be shown in user identity (admin / Users / Permissions / User policies) by ticking it in the list.
- Go to the browse list of users page (admin / Users / Accounts / Browse list of users). The new column should appear in the list of users.
- Click on the column name to sort by it.
You get the following error:
Error reading from database
More information about this error
Debug info: Unknown column 'profilefieldtestid' in 'order clause'
SELECT u.id, username, email, city, country, lastaccess, confirmed, mnethostid, suspended , uf1d_1.data AS profile_field_testid, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.firstname, u.lastname
FROM mdl_user u
JOIN mdl_user_info_field uf1f_1 ON uf1f_1.shortname = ?
LEFT JOIN mdl_user_info_data uf1d_1 ON uf1d_1.fieldid = uf1f_1.id
AND uf1d_1.userid = u.id
WHERE deleted <> 1 AND u.id <> ?
ORDER BY profilefieldtestid ASC LIMIT 0, 30
[array (
0 => 'testid',
1 => '1',
)]
Error code: dmlreadexception
Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1273 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 540 of /lib/datalib.php: call to mysqli_native_moodle_database->get_records_sql()
line 245 of /admin/user.php: call to get_users_listing()