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

forum_get_posts_by_user() throws groupmembersonly debugging notices

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8
    • Component/s: Forum
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Run the behat test mod/forum/tests/behat/my_forum_posts.feature
      Test 2
      1. Visit a course.
      2. Create a forum.
      3. Add a discussion.
      4. Add a post to that forum.
      5. Visit 'Navigation' -> 'Home' -> 'My profile' -> 'Forum posts' -> 'Posts' and ensure the posts are shown with no errors.
      6. Visit 'Navigation' -> 'Home' -> 'My profile' -> 'Forum posts' -> 'Discussions' and ensure the discussion is shown with no errors.
      Show
      Test 1 Run the behat test mod/forum/tests/behat/my_forum_posts.feature Test 2 Visit a course. Create a forum. Add a discussion. Add a post to that forum. Visit 'Navigation' -> 'Home' -> 'My profile' -> 'Forum posts' -> 'Posts' and ensure the posts are shown with no errors. Visit 'Navigation' -> 'Home' -> 'My profile' -> 'Forum posts' -> 'Discussions' and ensure the discussion is shown with no errors.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-47735_master

      Description

      1. Go to my profile > Forum Posts > Posts

      Debugging notices:

      $cm->groupmembersonly has been deprecated and always returns zero. If used to restrict a list of enrolled users to only those who can access the module, consider \core_availability\info_module::filter_user_list.
      line 1889 of /lib/modinfolib.php: call to debugging()
      line 1165 of /lib/modinfolib.php: call to cm_info->get_deprecated_group_members_only()
      line 1193 of /lib/modinfolib.php: call to cm_info->__get()
      line 7416 of /mod/forum/lib.php: call to cm_info->getIterator()
      line 128 of /mod/forum/user.php: call to forum_get_posts_by_user()
      

      As part of the fix for this issue, please write behat tests for this page - i've seen many errors on this page over the years, would be good to have coverage.

        Attachments

          Activity

            People

            Assignee:
            markn Mark Nelson
            Reporter:
            poltawski Dan Poltawski
            Peer reviewer:
            Andrew Nicols
            Integrator:
            Marina Glancy
            Tester:
            John Okely
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14