Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Modified a bit the xx_get_participants() function to avoid

non existing activities warnings.
  • Loading branch information...
commit b32bbab698389b281ddf7f102ed34a35286db6fd 1 parent 058a221
stronk7 authored
Showing with 12 additions and 6 deletions.
  1. +4 −2 mod/assignment/lib.php
  2. +8 −4 mod/forum/lib.php
View
6 mod/assignment/lib.php
@@ -520,8 +520,10 @@ function assignment_get_participants($assignmentid) {
u.id = a.teacher");
//Add teachers to students
- foreach ($teachers as $teacher) {
- $students[$teacher->id] = $teacher;
+ if ($teachers) {
+ foreach ($teachers as $teacher) {
+ $students[$teacher->id] = $teacher;
+ }
}
//Return students array (it contains an array of unique users)
return ($students);
View
12 mod/forum/lib.php
@@ -2138,12 +2138,16 @@ function forum_get_participants($forumid) {
u.id = r.userid");
//Add st_posts to st_subscriptions
- foreach ($st_posts as $st_post) {
- $st_subscriptions[$st_post->id] = $st_post;
+ if ($st_posts) {
+ foreach ($st_posts as $st_post) {
+ $st_subscriptions[$st_post->id] = $st_post;
+ }
}
//Add st_ratings to st_subscriptions
- foreach ($st_ratings as $st_rating) {
- $st_subscriptions[$st_rating->id] = $st_rating;
+ if ($st_ratings) {
+ foreach ($st_ratings as $st_rating) {
+ $st_subscriptions[$st_rating->id] = $st_rating;
+ }
}
//Return st_subscriptions array (it contains an array of unique users)
return ($st_subscriptions);
Please sign in to comment.
Something went wrong with that request. Please try again.