MDL-62543 forum: Switched the usage of the deleted flag for rss
authorTobias Reischmann <tobias.reischmann@wi.uni-muenster.de>
Wed, 23 May 2018 12:05:28 +0000 (14:05 +0200)
committerTobias Reischmann <tobias.reischmann@wi.uni-muenster.de>
Wed, 23 May 2018 12:05:28 +0000 (14:05 +0200)
The deleted flag was introduced through the Privacy API and was used
for post selection for the rss feed. In there it was used in the
wrong way, which lead to the exclusion of all non deleted posts instead
of excluding all deleted ones.
This commit fixes this problem.

mod/forum/rsslib.php

index f360627..5b30243 100644 (file)
@@ -189,7 +189,7 @@ function forum_rss_feed_discussions_sql($forum, $cm, $newsince=0) {
               FROM {forum_discussions} d
                    JOIN {forum_posts} p ON p.discussion = d.id
                    JOIN {user} u ON p.userid = u.id
-             WHERE d.forum = {$forum->id} AND p.parent = 0 AND p.deleted <> 0
+             WHERE d.forum = {$forum->id} AND p.parent = 0 AND p.deleted <> 1
                    $timelimit $groupselect $newsince
           ORDER BY $forumsort";
     return array($sql, $params);
@@ -243,7 +243,7 @@ function forum_rss_feed_posts_sql($forum, $cm, $newsince=0) {
                {forum_posts} p,
                {user} u
             WHERE d.forum = {$forum->id} AND
-                p.discussion = d.id AND p.deleted <> 0 AND
+                p.discussion = d.id AND p.deleted <> 1 AND
                 u.id = p.userid $newsince
                 $groupselect
             ORDER BY p.created desc";