mirror of
https://github.com/moodle/moodle.git
synced 2025-04-11 19:42:35 +02:00
MDL-40062 mod_forum: remove invalid add_to_log() calls
* debugging add_to_log() calls - the Moodle log is not the place for these kind of messages * subscribeall/unsusbcribeall - now individual subscriptions will fire events, there is no need for a catch all. * remove read tracking log entries - read tracking individual log entries do not provide enough reliable information, as the posts can be marked as read automatically after emailing or an expiry period.
This commit is contained in:
parent
692d247a3a
commit
33c40cc633
@ -197,10 +197,8 @@ if (!is_null($subscribe)) {
|
||||
$returnto = forum_go_back_to("index.php?id=$course->id");
|
||||
$shortname = format_string($course->shortname, true, array('context' => context_course::instance($course->id)));
|
||||
if ($subscribe) {
|
||||
add_to_log($course->id, 'forum', 'subscribeall', "index.php?id=$course->id", $course->id);
|
||||
redirect($returnto, get_string('nowallsubscribed', 'forum', $shortname), 1);
|
||||
} else {
|
||||
add_to_log($course->id, 'forum', 'unsubscribeall', "index.php?id=$course->id", $course->id);
|
||||
redirect($returnto, get_string('nowallunsubscribed', 'forum', $shortname), 1);
|
||||
}
|
||||
}
|
||||
|
@ -773,8 +773,6 @@ function forum_cron() {
|
||||
if (!$mailresult){
|
||||
mtrace("Error: mod/forum/lib.php forum_cron(): Could not send out mail for id $post->id to user $userto->id".
|
||||
" ($userto->email) .. not trying again.");
|
||||
add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#p$post->id",
|
||||
substr(format_string($post->subject,true),0,30), $cm->id, $userto->id);
|
||||
$errorcount[$post->id]++;
|
||||
} else {
|
||||
$mailcount[$post->id]++;
|
||||
@ -1073,9 +1071,8 @@ function forum_cron() {
|
||||
$mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, $attachment, $attachname);
|
||||
|
||||
if (!$mailresult) {
|
||||
mtrace("ERROR!");
|
||||
echo "Error: mod/forum/cron.php: Could not send out digest mail to user $userto->id ($userto->email)... not trying again.\n";
|
||||
add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id);
|
||||
mtrace("ERROR: mod/forum/cron.php: Could not send out digest mail to user $userto->id ".
|
||||
"($userto->email)... not trying again.");
|
||||
} else {
|
||||
mtrace("success.");
|
||||
$usermailcount++;
|
||||
|
@ -81,9 +81,7 @@ if ($mark == 'read') {
|
||||
print_error('invaliddiscussionid', 'forum');
|
||||
}
|
||||
|
||||
if (forum_tp_mark_discussion_read($user, $d)) {
|
||||
add_to_log($course->id, "discussion", "mark read", "view.php?f=$forum->id", $d, $cm->id);
|
||||
}
|
||||
forum_tp_mark_discussion_read($user, $d);
|
||||
} else {
|
||||
// Mark all messages read in current group
|
||||
$currentgroup = groups_get_activity_group($cm);
|
||||
@ -92,15 +90,12 @@ if ($mark == 'read') {
|
||||
// may return 0
|
||||
$currentgroup=false;
|
||||
}
|
||||
if (forum_tp_mark_forum_read($user, $forum->id,$currentgroup)) {
|
||||
add_to_log($course->id, "forum", "mark read", "view.php?f=$forum->id", $forum->id, $cm->id);
|
||||
}
|
||||
forum_tp_mark_forum_read($user, $forum->id,$currentgroup);
|
||||
}
|
||||
|
||||
/// FUTURE - Add ability to mark them as unread.
|
||||
// } else { // subscribe
|
||||
// if (forum_tp_start_tracking($forum->id, $user->id)) {
|
||||
// add_to_log($course->id, "forum", "mark unread", "view.php?f=$forum->id", $forum->id, $cm->id);
|
||||
// redirect($returnto, get_string("nowtracking", "forum", $info), 1);
|
||||
// } else {
|
||||
// print_error("Could not start tracking that forum", $_SERVER["HTTP_REFERER"]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user