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

Splitting a discussion creates discussion record with an incorrect first post author

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Waiting for peer review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.6, 3.6, 3.7
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
    • Testing Instructions:
      Hide

      Requires DB access to confirm.

      Prerequisite:

      • A course with a forum activity
      • 2 users(U1 & U2) enrolled into the course
      • A discussion(D1) within the forum - with replies by all users involved
      • A discussion(D2) within the forum created via the split functionality(of D1) in a way that the 2 discussions have different authors for their first posts(Do this before the patch is applied)
        Note: Make sure to note down the ids for D1 and D2

      Instructions:

      Case 1 - Upgrade steps - fix existing

      1. Apply the patch
      2. Run through the upgrade steps
      3. Go to the db
      4. Confirm the userid of D2 matches the userid of it's firstpost

      Case 2 - Split functionality - new splits

      1. As user U1, post a reply in D1
      2. As an admin, go to discussion D1
      3. Split U1's post from #1 into a new discussion(D3) - note down the id of the discussion
      4. Go to the db
      5. Confirm the userid of D3 matches the userid of it's firstpost
      Show
      Requires DB access to confirm. Prerequisite: A course with a forum activity 2 users(U1 & U2) enrolled into the course A discussion(D1) within the forum - with replies by all users involved A discussion(D2) within the forum created via the split functionality(of D1) in a way that the 2 discussions have different authors for their first posts( Do this before the patch is applied ) Note: Make sure to note down the ids for D1 and D2 Instructions: Case 1 - Upgrade steps - fix existing Apply the patch Run through the upgrade steps Go to the db Confirm the userid of D2 matches the userid of it's firstpost Case 2 - Split functionality - new splits As user U1, post a reply in D1 As an admin, go to discussion D1 Split U1's post from #1 into a new discussion(D3) - note down the id of the discussion Go to the db Confirm the userid of D3 matches the userid of it's firstpost
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65573-master

      Description

      When splitting a discussion we create a new discussion from the point of the split and move all reply posts into that new discussion.

      However the new discussion record doesn't have the "userid" field updated to match the id of the new first post user, it still references the same id as the discussion that was split.

      This results in a discussion record with invalid data where the userid field doesn't actually match the id of the author of the first post.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peterdias Peter Dias
                Reporter:
                ryanwyllie Ryan Wyllie
                Peer reviewer:
                Andrew Nicols
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 11 minutes
                  3h 11m