diff --git a/user/index.php b/user/index.php
index <HASH>..<HASH> 100644
--- a/user/index.php
+++ b/user/index.php
@@ -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";
MDL-<I> user: Add duplicate field check to avoid oracle db error.