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

get_user_preferences caching

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.3, 3.6
    • Fix Version/s: 3.5.4
    • Component/s: General, Performance
    • Labels:
    • Testing Instructions:
      Hide
      1. Copy the attached test.php into the document root
      2. Login to Moodle
      3. Access /test.php in the site
        1. Confirm you get an empty page

      Before this patch there is one call to fetch the DB records per call to get_user_preferences().

      Show
      Copy the attached test.php into the document root Login to Moodle Access /test.php in the site Confirm you get an empty page Before this patch there is one call to fetch the DB records per call to get_user_preferences() .
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-64049-master

      Description

      When get_user_preferences is called with the id of the current user it does not make use of the cache in the current $USER object.

      We can make use of the $USER when $userid matches $USER->id.

        Attachments

        1. screenshot-1.png
          screenshot-1.png
          26 kB
        2. test.php
          0.3 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jan/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m