Moodle
  1. Moodle
  2. MDL-33102

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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
    • Rank:
      40364

      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.

        Activity

        Hide
        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
        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
        Rajesh Taneja added a comment -

        Thanks Garret

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

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

        Show
        Sam Hemelryk added a comment - Changes look good thanks Raj, putting this up for integration for you now.
        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
        Frédéric Massart added a comment -

        Thanks guys. Successfully tested on 2.2 and 2.1.

        Show
        Frédéric Massart added a comment - Thanks guys. Successfully tested on 2.2 and 2.1.
        Hide
        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
        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: