Moodle
  1. Moodle
  2. MDL-30798

Recent blog entries block: "Entries about this course" link shows entries about other courses

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Blocks, Blog
    • Labels:
    • Database:
      MySQL
    • Testing Instructions:
      Hide
      1. Go to course A in which you are a Teacher, and turn on editing.
      2. Add Blog Menu block to course A
      3. Click Blog Menu > "Add an entry about this course" and add a blog post
      4. Go to course B in which you are also a Teacher, and turn on editing.
      5. Add Blog Menu and Recent Blog Entries blocks to course B
      6. Click Blog Menu > "Add an entry about this course" and add a blog post
      7. Click on Recent Blog Entries > Entries about this Course
      8. Verify that only blog posts associated with course B are listed.

      Test 2:
      Repeat above test for course activity (Write blog for activity and add blog menu and Recent Blog Entries block to activity page and click "View all entries about this

      {Activity}

      ")

      Show
      Go to course A in which you are a Teacher, and turn on editing. Add Blog Menu block to course A Click Blog Menu > "Add an entry about this course" and add a blog post Go to course B in which you are also a Teacher, and turn on editing. Add Blog Menu and Recent Blog Entries blocks to course B Click Blog Menu > "Add an entry about this course" and add a blog post Click on Recent Blog Entries > Entries about this Course Verify that only blog posts associated with course B are listed. Test 2: Repeat above test for course activity (Write blog for activity and add blog menu and Recent Blog Entries block to activity page and click "View all entries about this {Activity} ")
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-mdl-30798
    • Rank:
      33736

      Description

      The "recent blog entries" block, when listing recent entries, also displays a link to "entries about this course". However, this link actually shows all entries, about all courses.

      Tested in Moodle 2.1.3 (20111205)

      Steps to reproduce
      ==============
      1. Go to course A in which you are a Teacher, and turn on editing.
      2. Add Blog Menu block to course A
      3. Click Blog Menu > "Add an entry about this course" and add a blog post
      4. Go to course B in which you are also a Teacher, and turn on editing.
      5. Add Blog Menu and Recent Blog Entries blocks to course B
      6. Click Blog Menu > "Add an entry about this course" and add a blog post
      7. Click on Recent Blog Entries > Entries about this Course

      Expected result
      ===========
      Only blog entries associated with course B should be displayed.

      Actual result
      ===========
      All blog entries are shown, including those associated with course A. Any blog posts not associated with a course are also shown.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this.

          Yes, blogs can have odd contexts.

          Show
          Michael de Raadt added a comment - Thanks for reporting this. Yes, blogs can have odd contexts.
          Hide
          Jason Fowler added a comment -

          Estimated time to fix: 7 hours

          Show
          Jason Fowler added a comment - Estimated time to fix: 7 hours
          Hide
          Jason Fowler added a comment -

          looks good raj, but there is one whitespace change that doesn't seem to be required @ line 107

          Show
          Jason Fowler added a comment - looks good raj, but there is one whitespace change that doesn't seem to be required @ line 107
          Hide
          Rajesh Taneja added a comment -

          Thanks Jason,

          That was intentional to separate url code, keeping it a bit clean.

          Hope that is not a problem.

          Show
          Rajesh Taneja added a comment - Thanks Jason, That was intentional to separate url code, keeping it a bit clean. Hope that is not a problem.
          Hide
          Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Dan Poltawski added a comment -

          Hi Raj,

          I don't think your solution to this is the way to go. Rather than passing incorrect parameters to the $url in the first place and then removing them, we should build up the url params correctly to start with.

          It looks like 3 params could be in the url from $filter:

          • course - you are removing it and renaming
          • module - you are removing it and renmaing it
          • since - isn't even an accepted parameter in the destination url

          So passing in the $filter array is completely pointless and just creates some difficult to understand code.

          Show
          Dan Poltawski added a comment - Hi Raj, I don't think your solution to this is the way to go. Rather than passing incorrect parameters to the $url in the first place and then removing them, we should build up the url params correctly to start with. It looks like 3 params could be in the url from $filter: course - you are removing it and renaming module - you are removing it and renmaing it since - isn't even an accepted parameter in the destination url So passing in the $filter array is completely pointless and just creates some difficult to understand code.
          Hide
          Rajesh Taneja added a comment -

          Thanks for spotting that Dan,

          As discussed, I have updated all branches.

          Show
          Rajesh Taneja added a comment - Thanks for spotting that Dan, As discussed, I have updated all branches.
          Hide
          Dan Poltawski added a comment -

          Thanks Raj - i've integrated this now.

          Show
          Dan Poltawski added a comment - Thanks Raj - i've integrated this now.
          Hide
          Adrian Greeve added a comment -

          Tested in 2.2, 2.3 and master.
          No problems encountered.
          I created blog comments in courses and activities. No overlap occurs.
          Test passed

          Show
          Adrian Greeve added a comment - Tested in 2.2, 2.3 and master. No problems encountered. I created blog comments in courses and activities. No overlap occurs. Test passed
          Hide
          Dan Poltawski added a comment -

          *Notice*: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26

          Congratulations

          {tracker.user.name}

          !

          You've made into Moodle

          {tracker.fixversion-1}

          +

          I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world.

          cheers!

          {tracker.friendlyintegrator}
          Show
          Dan Poltawski added a comment - * Notice *: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26 Congratulations {tracker.user.name} ! You've made into Moodle {tracker.fixversion-1} + I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world. cheers! {tracker.friendlyintegrator}

            People

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

              Dates

              • Created:
                Updated:
                Resolved: