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

Change storage backend for user report filters

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.0
    • 5.0
    • Report builder
    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • Hide

      Before change

      1. Log in as admin
      2. Create a new user
      3. Make the new user a site admin
      4. Navigate to Users > Accounts > Browse list of users in site administration
      5. Open Filters and apply the following (in order to generate large amount of data):
        • Full name is not equal to:

          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultricies lacus libero. Nulla facilisi. Quisque ullamcorper, neque sit amet mattis maximus, elit nibh tempus purus, quis viverra lacus mauris id sapien. Duis vehicula orci et nunc vulputate ornare. In ac placerat est. Nullam viverra nulla ut enim cursus pellentesque. Nunc quis nisi ac neque lacinia pulvinar. Morbi ut velit tempus, venenatis erat in, tincidunt enim. Cras venenatis, nisi eget suscipit pretium, mauris magna gravida diam, quis vehicula massa eros quis felis. Quisque lorem massa, tempor vel leo nec, pharetra blandit nisl. Aenean tempor lobortis egestas. Aliquam sit amet sagittis urna, quis feugiat mi. Vestibulum et quam rutrum, congue ligula a, porta leo. Phasellus blandit, erat id dictum fringilla, eros lacus posuere nisi, blandit mollis arcu leo vel elit.
          

        • First name is equal to: Admin
      6. Navigate to Reports from user menu
      7. Create new report from Users report source
        • Include default setup: Yes
      8. Close editor
      9. Press Actions > View report for your new report
      10. Open Filters and apply the following:
        • Full name contains: Admin
      11. Log out
      12. Log in as new user
      13. Navigate to Users > Accounts > Browse list of users in site administration
      14. Open Filters and apply the following (in order to generate large amount of data):
        • Full name is not equal to:

          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mollis massa sed euismod dictum. Nunc lectus arcu, elementum id accumsan eu, euismod ut leo. Nunc ut tristique tortor. Donec sed nunc finibus, cursus est a, rhoncus ex. Mauris tempus tortor at sapien vestibulum rhoncus. Cras porta rhoncus fringilla. Nam eleifend quam vel ligula ornare, eget convallis nulla tempus. Sed et nisl imperdiet, fermentum ligula a, consequat purus. Sed pharetra nisl pharetra aliquam imperdiet. Morbi imperdiet tortor ac dignissim pellentesque. Proin et ipsum lacus. Sed vestibulum, metus vitae eleifend imperdiet, ipsum mi dictum nibh, a suscipit orci nulla in enim. Integer ut felis auctor nunc pellentesque consequat. Sed vitae fermentum magna. Mauris consectetur magna vitae nunc posuere porttitor. Ut bibendum convallis interdum.
          

        • First name is not equal to: Admin
      15. Navigate to Reports from user menu
      16. Press Actions > View report for the previously created report
      17. Open Filters and apply the following:
        • Full name does not contain: Admin
      18. Log out

      After change

      1. Log in as admin
      2. Run upgrade step
      3. Confirm the following query returns empty results (old preferences have been cleaned up):

        SELECT * FROM moodle.m_user_preferences WHERE name LIKE 'reportbuilder-report-%'
        

      4. Navigate to Users > Accounts > Browse list of users in site administration
      5. Open Filters
      6. Confirm the same filters are applied as per "Before change"
      7. Apply some different filters to the report
      8. Confirm they are applied, and persist after a page refresh
      9. Navigate to Reports from user menu
      10. Press Actions > View report for the previously created report
      11. Open Filters
      12. Confirm the same filters are applied as per "Before change"
      13. Apply some different filters to the report
      14. Confirm they are applied, and persist after a page refresh
      15. Log out
      16. Log in as new user
      17. Navigate to Users > Accounts > Browse list of users in site administration
      18. Open Filters
      19. Confirm the same filters are applied as per "Before change"
      20. Apply some different filters to the report
      21. Confirm they are applied, and persist after a page refresh
      22. Navigate to Reports from user menu
      23. Press Actions > View report for the previously created report
      24. Open Filters
      25. Confirm the same filters are applied as per "Before change"
      26. Apply some different filters to the report
      27. Confirm they are applied, and persist after a page refresh
      Show
      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: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultricies lacus libero. Nulla facilisi. Quisque ullamcorper, neque sit amet mattis maximus, elit nibh tempus purus, quis viverra lacus mauris id sapien. Duis vehicula orci et nunc vulputate ornare. In ac placerat est. Nullam viverra nulla ut enim cursus pellentesque. Nunc quis nisi ac neque lacinia pulvinar. Morbi ut velit tempus, venenatis erat in, tincidunt enim. Cras venenatis, nisi eget suscipit pretium, mauris magna gravida diam, quis vehicula massa eros quis felis. Quisque lorem massa, tempor vel leo nec, pharetra blandit nisl. Aenean tempor lobortis egestas. Aliquam sit amet sagittis urna, quis feugiat mi. Vestibulum et quam rutrum, congue ligula a, porta leo. Phasellus blandit, erat id dictum fringilla, eros lacus posuere nisi, blandit mollis arcu leo vel elit. 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: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mollis massa sed euismod dictum. Nunc lectus arcu, elementum id accumsan eu, euismod ut leo. Nunc ut tristique tortor. Donec sed nunc finibus, cursus est a, rhoncus ex. Mauris tempus tortor at sapien vestibulum rhoncus. Cras porta rhoncus fringilla. Nam eleifend quam vel ligula ornare, eget convallis nulla tempus. Sed et nisl imperdiet, fermentum ligula a, consequat purus. Sed pharetra nisl pharetra aliquam imperdiet. Morbi imperdiet tortor ac dignissim pellentesque. Proin et ipsum lacus. Sed vestibulum, metus vitae eleifend imperdiet, ipsum mi dictum nibh, a suscipit orci nulla in enim. Integer ut felis auctor nunc pellentesque consequat. Sed vitae fermentum magna. Mauris consectetur magna vitae nunc posuere porttitor. Ut bibendum convallis interdum. 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): SELECT * FROM moodle.m_user_preferences WHERE name LIKE 'reportbuilder-report-%' 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
    • Hide

      Code verified against automated checks with warnings.

      Checked MDL-83345 using repository: https://github.com/paulholden/moodle.git

      Should these errors be fixed?

      Built on: Tue 03 Dec 2024 04:46:39 PM UTC

      Show
      Code verified against automated checks with warnings. Checked MDL-83345 using repository: https://github.com/paulholden/moodle.git main (0 errors / 3 warnings) [branch: MDL-83345 | CI Job ] overview (0/0) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/3) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Should these errors be fixed? Built on: Tue 03 Dec 2024 04:46:39 PM UTC
    • Hide

      Launching automatic jobs for branch MDL-83345

      Built on: Fri Nov 15 10:31:22 UTC 2024

      Show
      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

      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

      MDL-46739 proposes to remove that length limit, and change the stored type to a TEXT field

      We 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

            pholden Paul Holden
            pholden Paul Holden
            Mohamed Shehata Mohamed Shehata
            David Carrillo David Carrillo
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 30 minutes
                3h 30m

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