Moodle
  1. Moodle
  2. MDL-43218

Link to blogs appears even when blogs not enabled

    Details

    • Testing Instructions:
      Hide
      1. Click Site Admin > Advanced Features
      2. Uncheck "Enable Blogs"
      3. Create a course
      4. Enrol the admin user
      5. Enter the course
      6. Click Navigation > Current Course > Course Name > Participants
      7. Check there is no link to "Course Blogs"
      8. Enable blogs again
      9. Check that admin can see site blogs and student can see course blogs
      10. Force separate groups in the course, enrol student in a group and make sure student can jump to his group's blog in the course only
      Show
      Click Site Admin > Advanced Features Uncheck "Enable Blogs" Create a course Enrol the admin user Enter the course Click Navigation > Current Course > Course Name > Participants Check there is no link to "Course Blogs" Enable blogs again Check that admin can see site blogs and student can see course blogs Force separate groups in the course, enrol student in a group and make sure student can jump to his group's blog in the course only
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master_MDL-43218

      Description

      Steps to reproduce

      1. Click Site Admin > Advanced Features
      2. Uncheck "Enable Blogs"
      3. Create a course
      4. Enrol the admin user
      5. Enter the course
      6. Click Navigation > Current Course > Course Name > Participants

      What should happen

      There should be no link to "Course blogs"

      What happens

      There is a link to "Course blogs". Clicking it gives an error:

      Blogging is disabled!

      More information about this error

      Debug info:
      Error code: blogdisable
      Stack trace:
      line 463 of /lib/setuplib.php: moodle_exception thrown
      line 38 of /blog/index.php: call to print_error()

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Jason Fowler added a comment -

            The patch looks great Simon. Can we please get some testing instructions entered in before pushing this for integration?

            Show
            Jason Fowler added a comment - The patch looks great Simon. Can we please get some testing instructions entered in before pushing this for integration?
            Hide
            Simon Coggins added a comment -

            Oops sorry, done now.

            Show
            Simon Coggins added a comment - Oops sorry, done now.
            Hide
            Jason Fowler added a comment -

            Thanks for that Simon

            Show
            Jason Fowler added a comment - Thanks for that Simon
            Hide
            Marina Glancy added a comment -

            Hi Simon, the patch looks good.
            Can I suggest a little performance improvement to add to it? It looks like a chunk of code https://github.com/totara/moodle/blob/6911db97f03ac22959520ef6f667ea103e924784/lib/navigationlib.php#L2458L2469 can also be moved into this "if" statement (and actually into the inner "if" statment). I would also not call groups_get_course_group() if we are on the frontpage because it may perform unnecessary db queries.

            Show
            Marina Glancy added a comment - Hi Simon, the patch looks good. Can I suggest a little performance improvement to add to it? It looks like a chunk of code https://github.com/totara/moodle/blob/6911db97f03ac22959520ef6f667ea103e924784/lib/navigationlib.php#L2458L2469 can also be moved into this "if" statement (and actually into the inner "if" statment). I would also not call groups_get_course_group() if we are on the frontpage because it may perform unnecessary db queries.
            Hide
            Marina Glancy added a comment -

            I added the commit with the change I was talking about:
            https://github.com/marinaglancy/moodle/compare/master...wip-MDL-43218-master
            git pull git://github.com/marinaglancy/moodle.git wip-MDL-43218-master

            this also looks like a bug that needs backporting

            Show
            Marina Glancy added a comment - I added the commit with the change I was talking about: https://github.com/marinaglancy/moodle/compare/master...wip-MDL-43218-master git pull git://github.com/marinaglancy/moodle.git wip- MDL-43218 -master this also looks like a bug that needs backporting
            Hide
            Sam Hemelryk added a comment -

            Thanks Simon + Marina, nice fix and improvement!

            Cheers
            Sam

            Show
            Sam Hemelryk added a comment - Thanks Simon + Marina, nice fix and improvement! Cheers Sam
            Hide
            David Monllaó added a comment -

            It passes, tested in 25 and master.

            A couple of things I've noticed, not part of this issue:

            • The link text is always the same, Course blogs both when is pointing to a course-level or group-level blogs
            • After clicking on Course blogs the next page shows a Blog about this Course both when is pointing to a course-level or group-level blogs
            Show
            David Monllaó added a comment - It passes, tested in 25 and master. A couple of things I've noticed, not part of this issue: The link text is always the same, Course blogs both when is pointing to a course-level or group-level blogs After clicking on Course blogs the next page shows a Blog about this Course both when is pointing to a course-level or group-level blogs
            Hide
            Marina Glancy added a comment -

            David, I already created issue MDL-43324 about wrong context on course blog page

            Show
            Marina Glancy added a comment - David, I already created issue MDL-43324 about wrong context on course blog page
            Hide
            Simon Coggins added a comment - - edited

            Thanks Marina, I go away for a few days and it's all fixed

            Show
            Simon Coggins added a comment - - edited Thanks Marina, I go away for a few days and it's all fixed
            Hide
            Marina Glancy added a comment -

            Also there is a workaround for this problem - just to revoke the capability to view blogs from all roles

            Show
            Marina Glancy added a comment - Also there is a workaround for this problem - just to revoke the capability to view blogs from all roles
            Hide
            Sam Hemelryk added a comment -

            Thanks for the code, its now upstream!

            Heres a fun trick to try in the spirit of Friday the 13th.
            I hear if you stand in front a mirror, alone, in the dark, and say "Oracle" three times Petr Skoka will appear in the mirror and you'll see him deleting the Oracle driver from Moodle.

            Show
            Sam Hemelryk added a comment - Thanks for the code, its now upstream! Heres a fun trick to try in the spirit of Friday the 13th. I hear if you stand in front a mirror, alone, in the dark, and say "Oracle" three times Petr Skoka will appear in the mirror and you'll see him deleting the Oracle driver from Moodle.
            Hide
            Gerald Hartwig added a comment -

            Hey,

            additional to this tracker entry:

            Link to user blogs are visible in user list, in spite of disbaling the blogs in website-administration.

            1.) Website-Administration > uncheck blogs
            2.) login as student, go into a course
            3.) navigatrion > current course > participants
            4.) user list : user details (not: brief)
            5.) links to user blogs are visible

            Using: Moodle 2.6.1

            Greetings
            Gerald

            Show
            Gerald Hartwig added a comment - Hey, additional to this tracker entry: Link to user blogs are visible in user list, in spite of disbaling the blogs in website-administration. 1.) Website-Administration > uncheck blogs 2.) login as student, go into a course 3.) navigatrion > current course > participants 4.) user list : user details (not: brief) 5.) links to user blogs are visible Using: Moodle 2.6.1 Greetings Gerald
            Hide
            Marina Glancy added a comment -

            Hello Gerald, this issue is already closed. Can you please create another issue in tracker if you think that there is more work to do.
            Thank you

            Show
            Marina Glancy added a comment - Hello Gerald, this issue is already closed. Can you please create another issue in tracker if you think that there is more work to do. Thank you
            Hide
            Paul Holden added a comment -

            Hi Marina Glancy, I've also noticed the same thing as described by Gerald Hartwig; I've created MDL-47408 to look at it

            Show
            Paul Holden added a comment - Hi Marina Glancy , I've also noticed the same thing as described by Gerald Hartwig ; I've created MDL-47408 to look at it

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: