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

Forum overview to show incorrect last post date time

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Pre-requisites and setup

      1. Have a Moodle site with at least one student (student1) enrolled in a course ('course1').
      2. Log in as admin.
      3. Navigate to course1.
      4. Turn editing on, and add a forum activity, with name 'Order Forum' and 'forum type' set to 'Standard forum for general use'. Save the forum to create it.
      5. Log out.

      Test 1: Correct 'last post' details and discussion order

      1. Log in as student1.
        Navigate to the 'Order Forum' within course1.
      2. Click 'Add a new discussion topic', set 'First' as the subject and message, and click 'Post to forum'.
      3. On the discussions view, CONFIRM the 'last post' for the 'First' discussion is listed as the student1's name, at the current time. Note this time and name down somewhere as "time1" and "name1" (they will be referred to later).
      4. Wait for 1 minute to elapse, so the time is now one minute past what you noted for time1.
      5. Click on the 'First' discussion, to open the discussion.
      6. Click 'Edit' on the post.
      7. Add some additional text to the post 'Message' field, then click 'save changes'.
      8. Navigate back to the forum discussions view for 'Order Forum'.
      9. CONFIRM editing the post has not changed the 'last post' details for 'First' (they are still the same as time1 and name1).
      10. Log out, and log back in as admin.
      11. Navigate back to the forum discussions view for 'Order Forum'.
      12. Click 'Add a new discussion topic', set "Second" as the subject and message, and click 'Post to forum'.
      13. On the discussions view, CONFIRM 'Second' is listed above 'First' in the discussion order.
      14. CONFIRM admin's name is shown for the 'last post' on the 'Second' discussion, and the timestamp is correct. Note the time and name down as 'time2' and 'name2'.
      15. Wait for 1 minute to elapse, so the time is now one minute past what you noted for time2.
      16. Add another discussion topic, with 'Third' as the subject and message.
      17. Click on 'Order Forum' in the page breadcrumbs to navigate back to the Order forum discussions view (or if you have it open in another tab, be sure to hard refresh the page).
      18. CONFIRM there are now 3 discussions, ordered Third, Second, First (from top to bottom). CONFIRM the last post details are correct for 'Third', and note them down as name3 and time3.
      19. Open the discussion named 'First', and click 'Edit'.
      20. CONFIRM the bottom of the message input has an 'edited by' line, with the admin's name, and the timestamp matches time1.
      21. Click 'Save changes'.
      22. Click on 'Order Forum' in the page breadcrumbs to navigate back to the Order forum discussions view (or if you have it open in another tab, be sure to hard refresh the page).
      23. CONFIRM the discussion list is still ordered (from top to bottom) Third, Second, First.
      24. Also CONFIRM Third has name3 and time3 listed under last post, Second has name2 and time2, and First has name1 and time1, ie editing has not changed any details or ordering on the discussion view.
      25. Open the 'Second' discussion, then click the 'Pin' button, to pin the discussion.
      26. Return to the 'Order Forum' discussions view using the page breadcrumbs.
      27. CONFIRM the discussion list is ordered (top to bottom) as Second, Third, First, and all details appear correct (the only change should be that pinned discussion has moved to the top of the list).
      28. Wait until at least 1 minute has elapsed since time3 was recorded (if it hasn't already).
      29. Open the 'First' discussion, and click 'Reply'.
      30. Set the message to 'First reply', and click 'Post to forum'.
      31. Note down the timestamp from the reply as time4.
      32. Return to the 'Order Forum' discussions view using the page breadcrumbs.
      33. CONFIRM the discussion list is ordered (top to bottom) as Second, First Third.
      34. CONFIRM the 'last post' details for the 'First' discussion are now showing the admin's name, and time4.
      35. CONFIRM the other 2 posts still show the correct 'last post' details (name2 and time2 for 'Second', and name3 and time3 for 'Third').

      Test 2: Correct subsequent admin edit string
      (Note: Stay logged in as admin for this test)

      1. Open the 'First' discussion.
      2. Click 'Edit' on student1's post.
      3. CONFIRM there are now 2 'Edited by' lines in the 'Message' text.
      4. CONFIRM both 'Edited by' lines are identical (ie same username and timestamp have been included in both).
      Show
      Pre-requisites and setup Have a Moodle site with at least one student (student1) enrolled in a course ('course1'). Log in as admin. Navigate to course1. Turn editing on, and add a forum activity, with name 'Order Forum' and 'forum type' set to 'Standard forum for general use'. Save the forum to create it. Log out. Test 1: Correct 'last post' details and discussion order Log in as student1. Navigate to the 'Order Forum' within course1. Click 'Add a new discussion topic', set 'First' as the subject and message, and click 'Post to forum'. On the discussions view, CONFIRM the 'last post' for the 'First' discussion is listed as the student1's name, at the current time. Note this time and name down somewhere as "time1" and "name1" (they will be referred to later). Wait for 1 minute to elapse, so the time is now one minute past what you noted for time1. Click on the 'First' discussion, to open the discussion. Click 'Edit' on the post. Add some additional text to the post 'Message' field, then click 'save changes'. Navigate back to the forum discussions view for 'Order Forum'. CONFIRM editing the post has not changed the 'last post' details for 'First' (they are still the same as time1 and name1). Log out, and log back in as admin. Navigate back to the forum discussions view for 'Order Forum'. Click 'Add a new discussion topic', set "Second" as the subject and message, and click 'Post to forum'. On the discussions view, CONFIRM 'Second' is listed above 'First' in the discussion order. CONFIRM admin's name is shown for the 'last post' on the 'Second' discussion, and the timestamp is correct. Note the time and name down as 'time2' and 'name2'. Wait for 1 minute to elapse, so the time is now one minute past what you noted for time2. Add another discussion topic, with 'Third' as the subject and message. Click on 'Order Forum' in the page breadcrumbs to navigate back to the Order forum discussions view (or if you have it open in another tab, be sure to hard refresh the page). CONFIRM there are now 3 discussions, ordered Third, Second, First (from top to bottom). CONFIRM the last post details are correct for 'Third', and note them down as name3 and time3. Open the discussion named 'First', and click 'Edit'. CONFIRM the bottom of the message input has an 'edited by' line, with the admin's name, and the timestamp matches time1. Click 'Save changes'. Click on 'Order Forum' in the page breadcrumbs to navigate back to the Order forum discussions view (or if you have it open in another tab, be sure to hard refresh the page). CONFIRM the discussion list is still ordered (from top to bottom) Third, Second, First. Also CONFIRM Third has name3 and time3 listed under last post, Second has name2 and time2, and First has name1 and time1, ie editing has not changed any details or ordering on the discussion view. Open the 'Second' discussion, then click the 'Pin' button, to pin the discussion. Return to the 'Order Forum' discussions view using the page breadcrumbs. CONFIRM the discussion list is ordered (top to bottom) as Second, Third, First, and all details appear correct (the only change should be that pinned discussion has moved to the top of the list). Wait until at least 1 minute has elapsed since time3 was recorded (if it hasn't already). Open the 'First' discussion, and click 'Reply'. Set the message to 'First reply', and click 'Post to forum'. Note down the timestamp from the reply as time4. Return to the 'Order Forum' discussions view using the page breadcrumbs. CONFIRM the discussion list is ordered (top to bottom) as Second, First Third. CONFIRM the 'last post' details for the 'First' discussion are now showing the admin's name, and time4. CONFIRM the other 2 posts still show the correct 'last post' details (name2 and time2 for 'Second', and name3 and time3 for 'Third'). Test 2: Correct subsequent admin edit string (Note: Stay logged in as admin for this test) Open the 'First' discussion. Click 'Edit' on student1's post. CONFIRM there are now 2 'Edited by' lines in the 'Message' text. CONFIRM both 'Edited by' lines are identical (ie same username and timestamp have been included in both).
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.4 Branch:
      MDL-63892-34-rework
    • Pull 3.5 Branch:
      MDL-63892-35-rework
    • Pull 3.6 Branch:
      MDL-63892-36-rework
    • Pull Master Branch:
      MDL-63892-master-rework

      Description

      This may be a regression introduced by MDL-35788, not checked (34, 35 and master).

      From michael Nodding

      Hi,
      the change for 3.4.6, 3.5.3 in mod/forum/lib.php
      https://github.com/andrewnicols/moodle/compare/5211af1658...MDL-35788-35#diff-968b624e975ad3df52446c206926d60aL3922

      - $usedate = (empty($post->timemodified)) ? $post->modified : $post->timemodified; // Just in case
       + $usedate = (empty($post->created)) ? $post->timemodified : $post->created;

      has caused the forum overview to show the incorrect LAST POST date/time (ie mod/forum/view.php?id=xx)

      It now displays the timestamp of discussion creation, which is misleading for teachers looking to scan forums for students postings.

        Attachments

        1. 1.PNG
          1.PNG
          98 kB
        2. 2.PNG
          2.PNG
          91 kB
        3. 3.PNG
          3.PNG
          67 kB

          Issue Links

            Activity

              People

              • Votes:
                28 Vote for this issue
                Watchers:
                33 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 45 minutes
                  45m