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

Timeline doesn't take into account the block_timeline_user_filter_preference

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Login as admin
      2. Create a new course, making sure start date is the past, and end date is disabled
      3. Create a new user
      4. Enrol user in course as a student
      5. Add a new assignment activity to the course
      6. Set the Due date field to be 4 months from now
      7. Disable the Remind me to grade by field
      8. Logout
      9. Login as the new user and navigate to Dashboard
      10. In the Timeline block, click the sort icon and choose Sort by courses
      11. In the Timeline block, click the time icon and choose Next 6 months
      12. Confirm you see the course/assignment in the timeline
      13. Navigate to Site home
      14. Navigate back to Dashboard
      15. Confirm you still see the course/assignment in the timeline
      Show
      Login as admin Create a new course, making sure start date is the past, and end date is disabled Create a new user Enrol user in course as a student Add a new assignment activity to the course Set the Due date field to be 4 months from now Disable the Remind me to grade by field Logout Login as the new user and navigate to Dashboard In the Timeline block, click the sort icon and choose Sort by courses In the Timeline block, click the time icon and choose Next 6 months Confirm you see the course/assignment in the timeline Navigate to Site home Navigate back to Dashboard Confirm you still see the course/assignment in the timeline
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull 3.8 Branch:
    • Pull 3.9 Branch:
    • Pull Master Branch:

      Description

      1 - In timeline, change the filter to "Sort by courses"

       

      2 - Change the length to 3 months.

      2.1 - The pref is saved in the database.

      2.2 - A call is made to the server with those params

      https://192.168.33.10/lib/ajax/service.php?sesskey=c7CfFhMT7U&info=core_calendar_get_action_events_by_courses
      [{"index":0,"methodname":"core_calendar_get_action_events_by_courses","args":{"courseids":["90","74"],"limitnum":6,"timesortfrom":1597032000,"timesortto":1604808000}}]

      (1604808000 - 1597032000) / 86400 = 90 (3 months days window)

       

      3 - Navigate away from the Dashboard and comeback

       

      4 - The same call is made to the server with those params
      [{"index":0,"methodname":"core_calendar_get_action_events_by_courses","args":{"courseids":[90,74],"limitnum":6,"timesortfrom":1597032000,"timesortto":1599624000}}]

      (1599624000 - 1597032000) / 86400 = 30 (back to 30 days window)

       

      The webservice seems to only receive $timesortfrom and $timesortto.

      /calendar/externallib.php line 591

      public static function get_calendar_action_events_by_courses(
      array $courseids, $timesortfrom = null, $timesortto = null, $limitnum = 10) {

       

      I think it should be the Javascript (probably /blocks/timeline/amd/src/view_courses.js) that should remember/ask for the block_timeline_user_filter_preference preference before it's first call when the dashboard loads.

      Moodle 3.8.4+ (Build: 20200807)

      Thank you

        Attachments

          Activity

            People

            Assignee:
            pholden Paul Holden
            Reporter:
            nicolas.dalpe Nicolas Dalpe
            Peer reviewer:
            Simey Lameze
            Integrator:
            Andrew Nicols
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Sep/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 40 minutes
                1h 40m