Change storage backend for user report filters
Description
Testing Instructions
Before change
Log in as admin
Create a new user
Make the new user a site admin
Navigate to Users > Accounts > Browse list of users in site administration
Open Filters and apply the following (in order to generate large amount of data):
Full name is not equal to:
First name is equal to: Admin
Navigate to Reports from user menu
Create new report from Users report source
Include default setup: Yes
Close editor
Press Actions > View report for your new report
Open Filters and apply the following:
Full name contains: Admin
Log out
Log in as new user
Navigate to Users > Accounts > Browse list of users in site administration
Open Filters and apply the following (in order to generate large amount of data):
Full name is not equal to:
First name is not equal to: Admin
Navigate to Reports from user menu
Press Actions > View report for the previously created report
Open Filters and apply the following:
Full name does not contain: Admin
Log out
After change
Log in as admin
Run upgrade step
Confirm the following query returns empty results (old preferences have been cleaned up):
Navigate to Users > Accounts > Browse list of users in site administration
Open Filters
Confirm the same filters are applied as per "Before change"
Apply some different filters to the report
Confirm they are applied, and persist after a page refresh
Navigate to Reports from user menu
Press Actions > View report for the previously created report
Open Filters
Confirm the same filters are applied as per "Before change"
Apply some different filters to the report
Confirm they are applied, and persist after a page refresh
Log out
Log in as new user
Navigate to Users > Accounts > Browse list of users in site administration
Open Filters
Confirm the same filters are applied as per "Before change"
Apply some different filters to the report
Confirm they are applied, and persist after a page refresh
Navigate to Reports from user menu
Press Actions > View report for the previously created report
Open Filters
Confirm the same filters are applied as per "Before change"
Apply some different filters to the report
Confirm they are applied, and persist after a page refresh
Automated test results
Launching automatic jobs for branch MDL-83345
https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17364/ PHPUnit (sqlsrv / --testsuite core_reportbuilder_testsuite)
https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59254/ Behat (NonJS - boost and classic / --tags @core_reportbuilder)
https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59255/ Behat (Firefox - boost / --tags @core_reportbuilder)
https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59256/ Behat (Firefox - classic / --tags @core_reportbuilder)
https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59257/ App tests (stable app version) / --tags @core_reportbuilder)
Built on: Fri Nov 15 10:31:22 UTC 2024
Pre-check results
Code verified against automated checks with warnings.
Checked https://moodle.atlassian.net/browse/MDL-83345#icft=MDL-83345 using repository: https://github.com/paulholden/moodle.git
Built on: Tue 03 Dec 2024 04:46:39 PM UTC
Workaround
Attachments
has a non-specific relationship to
has to be done before
Activity

Thanks for your contributions! This change is now available from the main moodle.git repository and will shortly be available on download.moodle.org.
Closing as fixed!

The issue has been successfully tested and implemented in version Main. Thank you!
3.
6.
8.
12.
14.
19.
21.
25.
27.

Thanks, Paul for working on this issue.
It has now been integrated \o/
Integrated to main only.
Over to testing.

Thanks @Paul Holden , great improvement! Everything looks good now and seems to be well tested

Thanks @Paul Holden for working on this, everything works fine
[ ] Syntax
[ ] Output
[] Component library
[ ] Language
[ ] Databases
[ ] Testing (instructions and automated tests)
[ ] Security
[ ] Privacy (see Privacy API)
[ ] Performance and Clustering
[ ] Documentation
[ ] Git
[] Third party code
[] Icons
[] The Moodle mobile app / web services
[] Accessibility
[ ] Overall completeness and correctness
Details
Details
Priority
Affects versions
Components
Assignee

Reporter

Peer reviewer

Integrator

Fix versions
Tester

Participants






Pull from Repository
Pull Main Diff URL
Pull Main Branch
Component Lead Review
Clockify
Start / Stop
Clockify

We currently use user preferences for storing report filter content for users when they filter reports
This includes workarounds for the maximum length of a given preference (up to Moodle 4.5), which we then have to post-process when retrieving
https://moodle.atlassian.net/browse/MDL-46739#icft=MDL-46739 proposes to remove that length limit, and change the stored type to a
TEXT
fieldWe can use this opportunity to re-factor the storage for user report filters to improve performance by avoiding polluting user preferences entirely, and migrating to a dedicated table schema/persistent for them