Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65665

Quick reply does not respect subscribe on reply user preference

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Need this testing in all branches, specifically 36_STABLE, where a new function is being added.

      1. # Log in as Admin
      2. Create a course.
      3. Create a Forum.
      4. Create 2 discussions (discussion1, discussion2).
      5. Enrol a user in the Course.

      Test auto-subscription

      1. Log in as the User enrolled in the Course.
      2. Go to the Forum 
        • make sure the user is not subscribed to discussion1 and discussion2.
      3. Go to User preferences > Forum preferences
        • set Forum auto-subscribe = "Yes: when I post, subscribe me to that forum discussion"
      4. Go back to the Forum.
      5. Go to  discussion1.
      6. Add an inline reply to a discussion post.
        • make sure the User is now automatically subscribed to discussion1 (reload might be needed to update the subscribe button in the discussion page)
      7. Go to User preferences > Forum preferences
        • set Forum auto-subscribe = "No: don't automatically subscribe me to forum discussions"
      8. Go back to the Forum.
      9. Go to  discussion2.
      10. Add an inline reply to a discussion post.
        • make sure the User is still not subscribed to discussion2 (reload might be needed to update the subscribe button in the discussion page)**

      Test webservice

      1. Log in as Admin.
      2. Enable web services (Site administration > Advanced features).
      3. Create a tokens for the User which is enrolled in the Course (Site administration > Plugins > Web services > Manage tokens).
        Please follow the additional instructions on how to configure/use web services (https://docs.moodle.org/37/en/Using_web_services)
      4. Log in as User.
      5. Go to the Course > Forum.
      6. Unsubscribe from discussion1 and discussion2. 
      7. Call the mod_forum_add_discussion_post web service as the User (discussionsubscribe = 1)

        MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_add_discussion_post&wstoken=TOKEN&postid=POSTID&subject=REPLYSUBJECT&message=REPLYMESSAGE&options[0][name]=discussionsubscribe&options[0][value]=1

        through a HTTP client for testing web services (ex. Postman) where:
        wstoken = the token created for the User; 
        postid = the ID of the discussion1 post the user is replying to;
        subject = the reply subject
        message = the reply message
        options =  additional option parameters
      8. Log in as User.
      9. Go to the Course > Forum > Discussion1
        • make sure the User is now automatically subscribed to Discussion1 and the post reply has been successfully created.
      10. Call the mod_forum_add_discussion_post web service as the User (discussionsubscribe = 0)

        MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_add_discussion_post&wstoken=TOKEN&postid=POSTID&subject=REPLYSUBJECT&message=REPLYMESSAGE&options[0][name]=discussionsubscribe&options[0][value]=0

        through a HTTP client for testing web services (ex. Postman) where:
        postid = the ID of the discussion2 post the user is replying to;
      11. As User, go to Course > Forum > DIscussion2
        • make sure the User is still not subscribed to Discussion2 and the post reply has been successfully created.
      12. As User, go to User preferences > Forum preferences
        • set Forum auto-subscribe = "Yes: when I post, subscribe me to that forum discussion"
      13. Call the mod_forum_add_discussion_post web service as the User, without passing a value for discussionsubscribe

        MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_add_discussion_post&wstoken=TOKEN&postid=POSTID&subject=REPLYSUBJECT&message=REPLYMESSAGE

        through a HTTP client for testing web services (ex. Postman) where:
        postid = the ID of the discussion2 post the user is replying to;
      14. Go to the Course > Forum > Discussion2
        • make sure the User is now automatically subscribed to Discussion2 and the post reply has been successfully created.
      Show
      Need this testing in all branches, specifically 36_STABLE, where a new function is being added. # Log in as Admin Create a course. Create a Forum. Create 2 discussions (discussion1, discussion2). Enrol a user in the Course. Test auto-subscription Log in as the User enrolled in the Course. Go to the Forum  make sure the user is not subscribed to discussion1 and discussion2. Go to User preferences > Forum preferences set Forum auto-subscribe = "Yes: when I post, subscribe me to that forum discussion" Go back to the Forum. Go to  discussion1. Add an inline reply to a discussion post. make sure the User is now automatically subscribed to discussion1 (reload might be needed to update the subscribe button in the discussion page) Go to User preferences > Forum preferences set Forum auto-subscribe = "No: don't automatically subscribe me to forum discussions" Go back to the Forum. Go to  discussion2. Add an inline reply to a discussion post. make sure the User is still not subscribed to discussion2 (reload might be needed to update the subscribe button in the discussion page) ** Test webservice Log in as Admin. Enable web services (Site administration > Advanced features). Create a tokens for the User which is enrolled in the Course (Site administration > Plugins > Web services > Manage tokens). Please follow the additional instructions on how to configure/use web services ( https://docs.moodle.org/37/en/Using_web_services ) Log in as User. Go to the Course > Forum. Unsubscribe from discussion1 and discussion2.  Call the mod_forum_add_discussion_post web service as the User (discussionsubscribe = 1) MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_add_discussion_post&wstoken=TOKEN&postid=POSTID&subject=REPLYSUBJECT&message=REPLYMESSAGE&options [0] [name] =discussionsubscribe&options [0] [value] =1 through a HTTP client for testing web services (ex. Postman) where: wstoken = the token created for the User;  postid = the ID of the discussion1 post the user is replying to; subject = the reply subject message = the reply message options =  additional option parameters Log in as User. Go to the Course > Forum > Discussion1 make sure the User is now automatically subscribed to Discussion1 and the post reply has been successfully created. Call the mod_forum_add_discussion_post web service as the User (discussionsubscribe = 0) MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_add_discussion_post&wstoken=TOKEN&postid=POSTID&subject=REPLYSUBJECT&message=REPLYMESSAGE&options [0] [name] =discussionsubscribe&options [0] [value] =0 through a HTTP client for testing web services (ex. Postman) where: postid = the ID of the discussion2 post the user is replying to; As User, go to Course > Forum > DIscussion2 make sure the User is still not subscribed to Discussion2 and the post reply has been successfully created. As User, go to User preferences > Forum preferences set Forum auto-subscribe = "Yes: when I post, subscribe me to that forum discussion" Call the mod_forum_add_discussion_post web service as the User, without passing a value for discussionsubscribe MOODLEINSTANCE/webservice/rest/server.php?wsfunction=mod_forum_add_discussion_post&wstoken=TOKEN&postid=POSTID&subject=REPLYSUBJECT&message=REPLYMESSAGE through a HTTP client for testing web services (ex. Postman) where: postid = the ID of the discussion2 post the user is replying to; Go to the Course > Forum > Discussion2 make sure the User is now automatically subscribed to Discussion2 and the post reply has been successfully created.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.6 Branch:
      MDL-65665-36-2
    • Pull 3.7 Branch:
      MDL-65665-37-2
    • Pull Master Branch:
      MDL-65665-master-2

      Description

      The code used in mod/forum/post.php is:

      $discussionsubscribe = \mod_forum\subscriptions::get_user_default_subscription($forumrecord, $coursecontext, $cm, null);
      

      The code in the add_discussion_post WS defaults to true

        Attachments

        1. MDL-65665.jpg
          MDL-65665.jpg
          50 kB
        2. MDL-65665 (2).jpg
          MDL-65665 (2).jpg
          52 kB
        3. MDL-65665 (3).jpg
          MDL-65665 (3).jpg
          32 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours, 40 minutes
                  6h 40m