Moodle
  1. Moodle
  2. MDL-36215

Course blogs navigation link is bad if groups are enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.3.2, 2.4.1, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Blog, Navigation
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as an admin
      2. Create a course and set group mode to separate and forced.
      3. Enrol some users
      4. Auto-create two groups
      5. Log out
      6. Log in as a student of the course
      7. Browse to the course
      8. Under navigation browse to Course > Participants > Course blogs.
      9. Make sure you arrive at a page using the groupid param and that you are within the course still.
      Show
      Log in as an admin Create a course and set group mode to separate and forced. Enrol some users Auto-create two groups Log out Log in as a student of the course Browse to the course Under navigation browse to Course > Participants > Course blogs. Make sure you arrive at a page using the groupid param and that you are within the course still.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
      wip-MDL-36215-m25

      Description

      In a course go to Participants -> Course blogs. It should take you to a URL like blog/index.php?courseid=2 where you can see the course blogs.

      If you have groups enabled, Participants -> Course blogs will still take you to a URL like blog/index.php?courseid=100 but that courseid may or may not exist. This is because when you have groups enabled the URL is supposed to be passing in a groupid and not a course id. In my case, it is passing a groupid of 100, but the blog/index.php is trying to load a course with an id of 100 instead of a group.

      Looking in the blog/index.php it accepts a groupid parameter. If you manually change courseid=100 to groupid=100 it takes you to the correct page.

      This is definitely happening on 2.2.3 and the code looks the same on 2.3.2.

        Gliffy Diagrams

          Activity

          Hide
          Sam Hemelryk added a comment -

          Putting this up for peer-review now.

          Show
          Sam Hemelryk added a comment - Putting this up for peer-review now.
          Hide
          Sam Hemelryk added a comment -

          Thanks for the report by the way Ray. I replicated it this morning and have put a fix up for peer-review now.

          Show
          Sam Hemelryk added a comment - Thanks for the report by the way Ray. I replicated it this morning and have put a fix up for peer-review now.
          Hide
          Sam Hemelryk added a comment -

          Putting this up for integration review in order to try and catch the coming release.

          Show
          Sam Hemelryk added a comment - Putting this up for integration review in order to try and catch the coming release.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (23, 24 & master), thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
          Hide
          Andrew Davis added a comment - - edited

          Hi Sam. Something is not quite right with the nav bar in 2.3.
          https://tracker.moodle.org/secure/attachment/31527/blognav.png

          Both "blog entries" links go to blog/index.php?groupid=2

          Trying master now.

          Show
          Andrew Davis added a comment - - edited Hi Sam. Something is not quite right with the nav bar in 2.3. https://tracker.moodle.org/secure/attachment/31527/blognav.png Both "blog entries" links go to blog/index.php?groupid=2 Trying master now.
          Hide
          Andrew Davis added a comment -

          The problem exists in master as well.

          I've also identified another problem. If you create groups but the student isn't in any of them or if you remove the student from their group weird stuff happens. If the student clicks on Course > Participants > Course blogs you're taken to blog/index.php?courseid=2. On that page the nav bar says "Home / ► Site pages / ► Site blogs / ► Blog entries" The site blogs link is active in the navigation block so the student has left the course.

          Show
          Andrew Davis added a comment - The problem exists in master as well. I've also identified another problem. If you create groups but the student isn't in any of them or if you remove the student from their group weird stuff happens. If the student clicks on Course > Participants > Course blogs you're taken to blog/index.php?courseid=2. On that page the nav bar says "Home / ► Site pages / ► Site blogs / ► Blog entries" The site blogs link is active in the navigation block so the student has left the course.
          Hide
          Andrew Davis added a comment -

          Marking this as failed for the time being pending a fix and/or the opening of another MDL.

          Show
          Andrew Davis added a comment - Marking this as failed for the time being pending a fix and/or the opening of another MDL.
          Hide
          Sam Hemelryk added a comment -

          Thanks Andrew for picking up those two points.

          I've looked into them this morning, it appears both are the result of blog/index.php not being set up correctly when groups are being involved.
          More specifically it looks like the hideous blogs_get_headers function is going to need tweaking.
          As the changes I've made here are about getting the navigation to write the links correctly I've decided it would be best to tackle these new issues as a separate issue (especially as blogs_get_headers can be a fickle function to modify).

          Re-opening for testing now that MDL-38357 has been created to deal with that.

          Many thanks
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Andrew for picking up those two points. I've looked into them this morning, it appears both are the result of blog/index.php not being set up correctly when groups are being involved. More specifically it looks like the hideous blogs_get_headers function is going to need tweaking. As the changes I've made here are about getting the navigation to write the links correctly I've decided it would be best to tackle these new issues as a separate issue (especially as blogs_get_headers can be a fickle function to modify). Re-opening for testing now that MDL-38357 has been created to deal with that. Many thanks Sam
          Hide
          Andrew Davis added a comment -

          Passing.

          Show
          Andrew Davis added a comment - Passing.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This is valid for unlimited entries to the, soon to be unveiled, Moodle Codebase Gardens. It includes free access to all facilities.

          Personal and non-transferable to all assignees, reviewers and testers in this issue. Valid until switching to Blackboard (100000€ penalization will be applied).

          Thanks, closing as fixed!

          Show
          Eloy Lafuente (stronk7) added a comment - This is valid for unlimited entries to the, soon to be unveiled, Moodle Codebase Gardens. It includes free access to all facilities. Personal and non-transferable to all assignees, reviewers and testers in this issue. Valid until switching to Blackboard (100000€ penalization will be applied). Thanks, closing as fixed!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: