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

Course Overview doesn't remember Starred filter state

XMLWordPrintable

    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE
    • MDL-67690-master
    • Hide

      With Master only

      You will need to do at least 3 upgrades to test this fully

      Starting in 3.7.x

      1. Upgrade straight to master with this patch
      2. Confirm there are no errors
      3. Confirm that displaygroupingfavourites is listed as a new setting

      Starting in 3.8.x or master without this patch (before-patch)

      1. Go to Admin settings > Plugins > Course overview, make sure displaygroupingstarred is enabled
      2. Move to master with this patch (after-patch)
      3. Run the upgrade
      4. Confirm there are no errors
      5. Confirm that displaygroupingfavourites is not listed as a new setting
      6. Go to Admin settings > Plugins > Course overview, make sure displaygroupingfavourites is enabled
      7. Run the SQL SELECT * FROM mdl_config_plugins WHERE name = 'displaygroupingstarred'; and confirm that no rows are returned

      Starting in 3.8.x or master without this patch (before-patch)

      1. Go to Admin settings > Plugins > Course overview, and disable displaygroupingstarred
      2. In config.php, add this line $CFG->forced_plugin_settings = ['block_myoverview' => ['displaygroupingstarred' => 1]];
      3. Go to Admin settings > Plugins > Course overview, and confirm displaygroupingstarred is now enabled with a config.php message
      4. Move to master with this patch (after-patch)
      5. Run the upgrade
      6. Confirm you see this message during the upgrade: Setting block_myoverview->displaygroupingstarred has been renamed to block_myoverview->displaygroupingfavourites. Old setting present in config.php.
        • If you use CLI upgrade, the >s will be escaped. This limitation is present in other core upgrade code, so I assume this is normal.
      7. Confirm that displaygroupingfavourites is not listed as a new setting
      8. Go to Admin settings > Plugins > Course overview, make sure displaygroupingfavourites is disabled
      9. In config.php, change displaygroupingstarred to displaygroupingfavourites
      10. Go to Admin settings > Plugins > Course overview, and confirm displaygroupingfavourites is now enabled with a config.php message
      11. Run the SQL SELECT * FROM mdl_config_plugins WHERE name = 'displaygroupingstarred'; and confirm that no rows are returned

      With 3.8 and Master

      Run behat

      1. Run with the --tags=@block_myoverview

      Test function

      1. In Admin settings > Plugins > Course overview, make sure displaygroupingstarred (for 3.8) and displaygroupingfavourites (for master) is enabled
      2. Create a user in at least one course
        • This can be admin, you just need to enrol them in the courses as a student/teacher
        • You may need many courses if you want to test all the permutations of the course overview filter
      3. On the dashboard, make sure you have the Course Overview block present
      4. Star a course
      5. Set the course filter to Starred
      6. Make sure the output is as expected
      7. Reload the page and confirm that the previous setting is remembered, and displays the correct courses
      8. Repeat the last 3 steps but with the other filter options
      9. Set the filter back to Starred
      10. As admin, navigate back to Admin settings > Plugins > Course overview, and disable displaygroupingstarred (for 3.8) or displaygroupingfavourites (for master)
      11. Go back to the dashboard as your user
      12. Confirm that Starred is not selected, and some other item is, most likely All (except).
      13. Confirm that the courses listed seem to match the expected output for the select filter
      14. Confirm that there are no errors (js console, PHP, etc)
      Show
      With Master only You will need to do at least 3 upgrades to test this fully Starting in 3.7.x Upgrade straight to master with this patch Confirm there are no errors Confirm that displaygroupingfavourites is listed as a new setting Starting in 3.8.x or master without this patch (before-patch) Go to Admin settings > Plugins > Course overview, make sure displaygroupingstarred is enabled Move to master with this patch (after-patch) Run the upgrade Confirm there are no errors Confirm that displaygroupingfavourites is not listed as a new setting Go to Admin settings > Plugins > Course overview, make sure displaygroupingfavourites is enabled Run the SQL SELECT * FROM mdl_config_plugins WHERE name = 'displaygroupingstarred'; and confirm that no rows are returned Starting in 3.8.x or master without this patch (before-patch) Go to Admin settings > Plugins > Course overview, and disable displaygroupingstarred In config.php, add this line $CFG->forced_plugin_settings = ['block_myoverview' => ['displaygroupingstarred' => 1] ]; Go to Admin settings > Plugins > Course overview, and confirm displaygroupingstarred is now enabled with a config.php message Move to master with this patch (after-patch) Run the upgrade Confirm you see this message during the upgrade: Setting block_myoverview->displaygroupingstarred has been renamed to block_myoverview->displaygroupingfavourites. Old setting present in config.php. If you use CLI upgrade, the >s will be escaped. This limitation is present in other core upgrade code, so I assume this is normal. Confirm that displaygroupingfavourites is not listed as a new setting Go to Admin settings > Plugins > Course overview, make sure displaygroupingfavourites is disabled In config.php, change displaygroupingstarred to displaygroupingfavourites Go to Admin settings > Plugins > Course overview, and confirm displaygroupingfavourites is now enabled with a config.php message Run the SQL SELECT * FROM mdl_config_plugins WHERE name = 'displaygroupingstarred'; and confirm that no rows are returned With 3.8 and Master Run behat Run with the --tags=@block_myoverview Test function In Admin settings > Plugins > Course overview, make sure displaygroupingstarred (for 3.8) and displaygroupingfavourites (for master) is enabled Create a user in at least one course This can be admin, you just need to enrol them in the courses as a student/teacher You may need many courses if you want to test all the permutations of the course overview filter On the dashboard, make sure you have the Course Overview block present Star a course Set the course filter to Starred Make sure the output is as expected Reload the page and confirm that the previous setting is remembered, and displays the correct courses Repeat the last 3 steps but with the other filter options Set the filter back to Starred As admin, navigate back to Admin settings > Plugins > Course overview, and disable displaygroupingstarred (for 3.8) or displaygroupingfavourites (for master) Go back to the dashboard as your user Confirm that Starred is not selected, and some other item is, most likely All (except). Confirm that the courses listed seem to match the expected output for the select filter Confirm that there are no errors (js console, PHP, etc)

      For some reason Starred isn't sticky like all the other filter states.

      If you set the filter state to Starred in the Course Overview block, when you come back to the dashboard it will be set to "All (Except removed from view)".

      Details provided by Bruno Malaval

      At login the block Overview on the dashboard doesn't display favourites (starred) courses when user choose it as default display.

      It works for other lists (all, in progress, past, ..) but not for favourites courses.
      The block Overview displays the default choice instead of user's setting.

      I take a look at the code, it seems that since Moodle 3.8, two terms are used :
      "favourites" & "starred".

      In a 3.8+ server, I temporary solved this by adding in mdl_config_plugins table an entry with :
      block_myoverview / displaygroupingfavourites / 1

      in addition of
      block_myoverview / displaygroupingstarred / 1

      Thanks a lot

      Bruno

            emerrill Eric Merrill
            emerrill Eric Merrill
            Ferran Recio Ferran Recio
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 40 minutes
                1d 3h 40m

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