Skip to content

Commit

Permalink
MDL-63690 core_blog: Handle when user blog posts are not being returned
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Oct 31, 2018
1 parent 244c0e1 commit 4acdbe5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions blog/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ public static function get_users_in_context(\core_privacy\local\request\userlist
}, $posts);
$userlist->add_users($userids);

// Add any user's who posted on the blog.
list($insql, $inparams) = $DB->get_in_or_equal(array_keys($posts), SQL_PARAMS_NAMED);
\core_comment\privacy\provider::get_users_in_context_from_sql($userlist, 'c', 'blog', 'format_blog', null, $insql,
if (!empty($posts)) {
// Add any user's who posted on the blog.
list($insql, $inparams) = $DB->get_in_or_equal(array_keys($posts), SQL_PARAMS_NAMED);
\core_comment\privacy\provider::get_users_in_context_from_sql($userlist, 'c', 'blog', 'format_blog', null, $insql,
$inparams);
}
} else if ($context->contextlevel == CONTEXT_USER) {
$params = ['userid' => $context->instanceid];

Expand Down

0 comments on commit 4acdbe5

Please sign in to comment.