From b1ba14f8c0f7ffc442b211be66d46677ef1d6241 Mon Sep 17 00:00:00 2001 From: nfreear Date: Tue, 7 Nov 2006 16:02:28 +0000 Subject: [PATCH] Fixes from unit test $groupinfo->picture, groups_users_in_common_group (Bug MDL-7380 "groups".) --- group/lib/basicgrouplib.php | 54 +++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/group/lib/basicgrouplib.php b/group/lib/basicgrouplib.php index c8a450db2d..af826528ec 100644 --- a/group/lib/basicgrouplib.php +++ b/group/lib/basicgrouplib.php @@ -1,22 +1,25 @@ dirroot.'/group/db/dbbasicgrouplib.php'); @@ -97,6 +100,7 @@ function groups_get_group_settings($groupid) { * @return string The path of the image for the group */ function groups_get_group_image_path($groupid) { + $image = ''; //TODO: ?? return $CFG->dataroot.'/groups/'.$groupid.'/'.$image; } @@ -138,13 +142,10 @@ function groups_get_users_not_in_group($courseid, $groupid) { * if an error occurred. */ function groups_users_in_common_group($userid1, $userid2) { - return groups_db_users_in_common_group($userid1, $userid1); + return groups_db_users_in_common_group($userid1, $userid2); } - - - /***************************** Membership functions *****************************/ @@ -194,30 +195,30 @@ function groups_set_default_group_settings($groupinfo = null) { if (!isset($groupinfo->name)) { $groupinfo->name = 'Temporary Group Name'; } - + if (!isset($groupinfo->description)) { $groupinfo->description = ''; } - + if (!isset($groupinfo->lang)) { $groupinfo->lang = current_language(); } - + if (!isset($groupinfo->theme)) { $groupinfo->theme = ''; } - + if (!isset($groupinfo->picture)) { - $groupinfo->picture = ''; + $groupinfo->picture = 0; } if (!isset($groupinfo->hidepicture)) { - $groupinfo->hidepicture = '1'; + $groupinfo->hidepicture = 1; } - + if (isset($groupinfo->hidepicture)) { - if ($groupinfo->hidepicture != '0' and $groupinfo->hidepicture != '1') { - $groupinfo->hidepicture = '1'; + if ($groupinfo->hidepicture != 0 and $groupinfo->hidepicture != 1) { + $groupinfo->hidepicture = 1; } } @@ -309,4 +310,5 @@ function groups_delete_group($groupid) { function groups_remove_member($userid, $groupid) { return groups_db_remove_member($userid, $groupid); } + ?> \ No newline at end of file -- 2.39.5