Skip to content

Commit e49a2aa

Browse files
committed
Minor - Avoid notice in forum and groups
1 parent b572f71 commit e49a2aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

main/forum/viewforum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345

346346
if ($origin != 'learnpath') {
347347
if ($origin=='group') {
348-
echo '<a href"=' . api_get_path(WEB_CODE_PATH) . 'group/group_space.php?'
348+
echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'group/group_space.php?'
349349
. api_get_cidreq() . '&gradebook=' . $gradebook . '">'
350350
. Display::return_icon('back.png', get_lang('BackTo')
351351
. ' ' . get_lang('Groups'), '', ICON_SIZE_MEDIUM) . '</a>';

main/inc/lib/groupmanager.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ public static function fill_groups($group_ids)
11941194
}
11951195

11961196
$category = self::get_category_from_group($group_ids[0]);
1197-
$groups_per_user = $category['groups_per_user'];
1197+
$groups_per_user = (isset($category['groups_per_user']) ? $category['groups_per_user'] : self::GROUP_PER_MEMBER_NO_LIMIT);
11981198
$group_table = Database:: get_course_table(TABLE_GROUP);
11991199
$group_user_table = Database:: get_course_table(TABLE_GROUP_USER);
12001200
$session_id = api_get_session_id();
@@ -1229,7 +1229,7 @@ public static function fill_groups($group_ids)
12291229
*/
12301230
for ($i = 0; $i < count($complete_user_list); $i ++) {
12311231
//find # of groups the user is enrolled in
1232-
$number_of_groups = self :: user_in_number_of_groups($complete_user_list[$i]["user_id"], $category['id']);
1232+
$number_of_groups = self :: user_in_number_of_groups($complete_user_list[$i]["user_id"], (isset($category['id'])?$category['id']:null));
12331233
//add # of groups to user list
12341234
$complete_user_list[$i]['number_groups_left'] = $number_groups_per_user - $number_of_groups;
12351235
}

0 commit comments

Comments
 (0)