MDL-23600 MNet: do not rely on existing user record with ID 1

This commit is contained in:
David Mudrak 2010-08-08 10:58:38 +00:00
parent 50e798c8a4
commit 4378e6a2ff

View file

@ -633,8 +633,8 @@ function mnet_profile_field_options() {
'picture', 'picture',
); );
// get a random user field from the database to pull the fields off // get a random user record from the database to pull the fields off
$randomuser = $DB->get_record('user', array('id' => 1)); $randomuser = $DB->get_record('user', array(), '*', IGNORE_MULTIPLE);
foreach ($randomuser as $key => $discard) { foreach ($randomuser as $key => $discard) {
if (in_array($key, $excludes) || in_array($key, $forced)) { if (in_array($key, $excludes) || in_array($key, $forced)) {
continue; continue;