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

Blog level upgrade from 1.9 to 2.2 - user ids are lost

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.2.3
    • Fix Version/s: 2.1.7, 2.2.4
    • Component/s: Administration, Blog, Forum
    • Labels:
      None
    • Testing Instructions:
      Hide

      In Moodle 1.9, create a blog, and set the visibility to "Users can only see blogs for people who share a course." Use a variety of test accounts to make posts to the blog.

      Upgrade the site to Moodle 2.2.

      After upgrading, run the Blog Level Update utility, at the url:
      /admin/tool/bloglevelupgrade/

      (Note that the blog upgrade utility does not run automatically as part of the standard upgrade routines. You must run the tool manually – you can find it in Site Admin, Tools)

      The utility converts legacy blogs which have visibility set at the course level, into forums of type blog.

      After upgrading, navigate to the course, and find the forum that has been created to hold the blog postings.

      Check if the blog posts are owned by the proper person, or by you (the admin of the site - the user that just ran the blog update utility).

      -Garret

      NOTE:
      Repeat test on master and 2.1
      In 2.1 update link is admin/bloglevelupgrade.php

      Show
      In Moodle 1.9, create a blog, and set the visibility to "Users can only see blogs for people who share a course." Use a variety of test accounts to make posts to the blog. Upgrade the site to Moodle 2.2. After upgrading, run the Blog Level Update utility, at the url: /admin/tool/bloglevelupgrade/ (Note that the blog upgrade utility does not run automatically as part of the standard upgrade routines. You must run the tool manually – you can find it in Site Admin, Tools) The utility converts legacy blogs which have visibility set at the course level, into forums of type blog. After upgrading, navigate to the course, and find the forum that has been created to hold the blog postings. Check if the blog posts are owned by the proper person, or by you (the admin of the site - the user that just ran the blog update utility). -Garret NOTE: Repeat test on master and 2.1 In 2.1 update link is admin/bloglevelupgrade.php
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-mdl-33102

      Description

      When I run the blog level upgrade utility in moodle 2.2, the userids of all blog posters are replaced with my user ID. (I am the logged in user who is running the utility.) As a result, every migrated post has my name and avatar on it.

      I believe I found a mistake in the code, and a simple fix.

      Line 124 of admin/tool/bloglevelupgrade/index.php:

      change:
      $discussionid = forum_add_discussion($discussion, null, $message);

      to:
      $discussionid = forum_add_discussion($discussion, null, $message, $blogentry->userid);

      Also see:
      http://moodle.org/mod/forum/discuss.php?d=201802

      At least one other Moodler has experienced this issue.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            rajeshtaneja Rajesh Taneja added a comment - - edited

            Thanks Garret, for spotting and reporting this issue. I will create patch and try to get this integrated.
            Can you please update test instructions, so patch can be tested.

            Show
            rajeshtaneja Rajesh Taneja added a comment - - edited Thanks Garret, for spotting and reporting this issue. I will create patch and try to get this integrated. Can you please update test instructions, so patch can be tested.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Thanks Garret

            Show
            rajeshtaneja Rajesh Taneja added a comment - Thanks Garret
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Changes look good thanks Raj, putting this up for integration for you now.

            Show
            samhemelryk Sam Hemelryk added a comment - Changes look good thanks Raj, putting this up for integration for you now.
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks Raj, i've integrated this now

            Show
            poltawski Dan Poltawski added a comment - Thanks Raj, i've integrated this now
            Hide
            fred Frédéric Massart added a comment -

            Thanks guys. Successfully tested on 2.2 and 2.1.

            Show
            fred Frédéric Massart added a comment - Thanks guys. Successfully tested on 2.2 and 2.1.
            Hide
            poltawski Dan Poltawski added a comment -

            Congratulations!

            Your work has made into the latest Moodle release!

            You are only authorised to celebrate after testing 15 Moodle 2.3 QA tests, thanks!

            Show
            poltawski Dan Poltawski added a comment - Congratulations! Your work has made into the latest Moodle release! You are only authorised to celebrate after testing 15 Moodle 2.3 QA tests, thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/12