MDL-66755 forum: Subscription cancel when edit a message
authorSergio Comerón <sergiocomeron@icloud.com>
Mon, 13 Jul 2020 16:25:07 +0000 (18:25 +0200)
committerSergio Comerón <sergiocomeron@icloud.com>
Fri, 24 Jul 2020 07:05:17 +0000 (09:05 +0200)
mod/forum/classes/subscriptions.php

index ca4c7df..af3f57e 100644 (file)
@@ -850,7 +850,7 @@ class subscriptions {
             // User does not have permission to unsubscribe from this discussion at all.
             $discussionsubscribe = true;
         } else {
             // User does not have permission to unsubscribe from this discussion at all.
             $discussionsubscribe = true;
         } else {
-            if (isset($discussion) && \mod_forum\subscriptions::is_subscribed($USER->id, $forum, $discussionid, $cm)) {
+            if (isset($discussionid) && self::is_subscribed($USER->id, $forum, $discussionid, $cm)) {
                 // User is subscribed to the discussion - continue the subscription.
                 $discussionsubscribe = true;
             } else if (!isset($discussionid) && \mod_forum\subscriptions::is_subscribed($USER->id, $forum, null, $cm)) {
                 // User is subscribed to the discussion - continue the subscription.
                 $discussionsubscribe = true;
             } else if (!isset($discussionid) && \mod_forum\subscriptions::is_subscribed($USER->id, $forum, null, $cm)) {