MDL-47689 user: Add duplicate field check to avoid oracle db error.

This commit is contained in:
Dave Cooper 2014-10-23 15:08:14 +08:00 committed by Eloy Lafuente (stronk7)
parent 7a811fb63a
commit 368f0bf8f6

View File

@ -410,9 +410,9 @@ list($esql, $params) = get_enrolled_sql($context, null, $currentgroup, true);
$joins = array("FROM {user} u");
$wheres = array();
$mainuserfields = user_picture::fields('u', array('username', 'email', 'city', 'country', 'lang', 'timezone', 'maildisplay'));
$alreadyretrievedfields = explode(',', $mainuserfields);
$extrasql = get_extra_user_fields_sql($context, 'u', '', $alreadyretrievedfields);
$userfields = array('username', 'email', 'city', 'country', 'lang', 'timezone', 'maildisplay');
$mainuserfields = user_picture::fields('u', $userfields);
$extrasql = get_extra_user_fields_sql($context, 'u', '', $userfields);
if ($isfrontpage) {
$select = "SELECT $mainuserfields, u.lastaccess$extrasql";