Commit d408e842 authored by lindonb's avatar lindonb

[bp/r62307][FIX] forum watches: wrong method call resulted in no watches being...

[bp/r62307][FIX] forum watches: wrong method call resulted in no watches being returned for notifications; additionally, the new $threadId posted was being used instead of the parentId also causing a watch notification to not be sent. (thanks Tommy on stackoverflow for reporting)
parent 434685b3
......@@ -110,7 +110,7 @@ function sendForumEmailNotification(
// Users watching this forum or this post
if ($prefs['feature_user_watches'] == 'y' || $prefs['feature_group_watches'] == 'y') {
$nots_raw = $tikilib->get_event_watches($event, $event == 'forum_post_topic'? $forum_info['forumId']: $threadId, $forum_info);
$nots_raw = $tikilib->get_event_watches($event, $event == 'forum_post_topic'? $forum_info['forumId']: $parentId, $forum_info);
$nots = array();
$users = array();
foreach ( $nots_raw as $n ) {
......
......@@ -395,13 +395,13 @@ if ($prefs['feature_user_watches'] == 'y') {
}
}
if ($user && $watch = $tikilib->user_watches($user, 'forum_post_topic', $_REQUEST['forumId'], 'forum')) {
if ($user && $watch = $tikilib->get_user_event_watches($user, 'forum_post_topic', $_REQUEST['forumId'])) {
$smarty->assign('user_watching_forum', 'y');
} else {
$smarty->assign('user_watching_forum', 'n');
}
if ($user && $watch = $tikilib->user_watches($user, 'forum_post_topic_and_thread', $_REQUEST['forumId'], 'forum')) {
if ($user && $watch = $tikilib->get_user_event_watches($user, 'forum_post_topic_and_thread', $_REQUEST['forumId'])) {
$smarty->assign('user_watching_forum_topic_and_thread', 'y');
} else {
$smarty->assign('user_watching_forum_topic_and_thread', 'n');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment