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

Calendar events may not show up for user

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77392-401
    • MDL-77392-master
    • Hide

      Covered by a new Behat test
      calendar/tests/behat/calender_filter.feature

      Without the patch in calendar/lib.php the test should fail:

      root@11cebb82f199:/var/www/html# vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml calendar/tests/behat/calender_filter.feature
      Moodle 4.2dev (Build: 20230310), 768cbba1cebfff82bad04bf1e6110ae3d8c23b31
      Php: 8.1.15, pgsql: 13.10 (Debian 13.10-1.pgdg110+1), OS: Linux 5.10.0-18-amd64 x86_64
      Run optional tests:
      - Accessibility: No
      Server OS "Linux", Browser: "firefox"
      Started at 14-03-2023, 23:02
      ................................................................F----- 70
      ----- Failed steps:001 Scenario: Teacher of a Course can see all events because session is used and not user preference calendar_savedflt # /var/www/html/calendar/tests/behat/calender_filter.feature:86
            Then I should see "C1 event"                                                                                     # /var/www/html/calendar/tests/behat/calender_filter.feature:93
              "C1 event" text was not found in the page (Behat\Mink\Exception\ExpectationException)3 scenarios (2 passed, 1 failed)
      72 steps (64 passed, 1 failed, 7 skipped)
      0m50.45s (60.36Mb)
      

      With the patch applied in calendar/lib.php the test should not fail:

      root@11cebb82f199:/var/www/html# vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml calendar/tests/behat/calender_filter.feature
      Moodle 4.2dev (Build: 20230310), 768cbba1cebfff82bad04bf1e6110ae3d8c23b31
      Php: 8.1.15, pgsql: 13.10 (Debian 13.10-1.pgdg110+1), OS: Linux 5.10.0-18-amd64 x86_64
      Run optional tests:
      - Accessibility: No
      Server OS "Linux", Browser: "firefox"
      Started at 14-03-2023, 23:03
      ...................................................................... 70
      ..3 scenarios (3 passed)
      72 steps (72 passed)
      0m44.13s (60.36Mb)
      

      Show
      Covered by a new Behat test calendar/tests/behat/calender_filter.feature Without the patch in calendar/lib.php the test should fail: root @11cebb82f199 :/var/www/html# vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml calendar/tests/behat/calender_filter.feature Moodle 4 .2dev (Build: 20230310 ), 768cbba1cebfff82bad04bf1e6110ae3d8c23b31 Php: 8.1 . 15 , pgsql: 13.10 (Debian 13.10 - 1 .pgdg110+ 1 ), OS: Linux 5.10 . 0 - 18 -amd64 x86_64 Run optional tests: - Accessibility: No Server OS "Linux" , Browser: "firefox" Started at 14 - 03 - 2023 , 23 : 02 ................................................................F----- 70 ----- Failed steps: 001 Scenario: Teacher of a Course can see all events because session is used and not user preference calendar_savedflt # /var/www/html/calendar/tests/behat/calender_filter.feature: 86       Then I should see "C1 event"                                                                                     # /var/www/html/calendar/tests/behat/calender_filter.feature: 93         "C1 event" text was not found in the page (Behat\Mink\Exception\ExpectationException) 3 scenarios ( 2 passed, 1 failed) 72 steps ( 64 passed, 1 failed, 7 skipped) 0m50.45s ( 60 .36Mb) With the patch applied in calendar/lib.php the test should not fail: root @11cebb82f199 :/var/www/html# vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml calendar/tests/behat/calender_filter.feature Moodle 4 .2dev (Build: 20230310 ), 768cbba1cebfff82bad04bf1e6110ae3d8c23b31 Php: 8.1 . 15 , pgsql: 13.10 (Debian 13.10 - 1 .pgdg110+ 1 ), OS: Linux 5.10 . 0 - 18 -amd64 x86_64 Run optional tests: - Accessibility: No Server OS "Linux" , Browser: "firefox" Started at 14 - 03 - 2023 , 23 : 03 ...................................................................... 70 .. 3 scenarios ( 3 passed) 72 steps ( 72 passed) 0m44.13s ( 60 .36Mb)

      One of our lecturers complained that some of his calendar events don't show up in the calendar. After a long hunt I was finally able to track down the issue.

      There are the following user preferences settings:

      • calendar_persistflt
      • calendar_savedflt

      For the first there are two options "0" => no and "1" => yes. The latter contains a number between 0 and 15 that represents a bit pattern of:

      • CALENDAR_EVENT_SITE
      • CALENDAR_EVENT_COURSE
      • CALENDAR_EVENT_GROUP
      • CALENDAR_EVENT_USER

      The problem here was that the latter setting was used always because when evaluating the first setting the type save comparism worked only with the default value.

      This then is no problem when the second setting contains the pattern that includes all of the four calendar events. Unfortunately our user had excluded the CALENDAR_EVENT_COURSE bit. Hence most of his calendar items did not show up.

            strobotta Stephan Robotta
            strobotta Stephan Robotta
            Luca Bösch Luca Bösch
            Paul Holden Paul Holden
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.