mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-64049 core: Cache prefs for current user
We were already caching these preferences when a user object is provided to get_user_preferences, or when $USER is provided. This changee swaps get_user_preferences to use the global USER object when the USER->id matches the userid supplied to the function.
This commit is contained in:
parent
01acb1ea90
commit
8cba8d1a58
2 changed files with 10 additions and 13 deletions
|
@ -64,18 +64,11 @@ class repository_flickr_privacy_testcase extends provider_testcase {
|
|||
$this->assertFalse($writer->has_any_data());
|
||||
|
||||
// Test exporting of Flickr repository user preferences *with* OAuth token/secret preference configured.
|
||||
$preference = (object) [
|
||||
'userid' => $user->id,
|
||||
'name' => 'repository_flickr_access_token',
|
||||
'value' => 'dummy flickr oauth access token'
|
||||
];
|
||||
$DB->insert_record('user_preferences', $preference);
|
||||
$preference = (object) [
|
||||
'userid' => $user->id,
|
||||
'name' => 'repository_flickr_access_token_secret',
|
||||
'value' => 'dummy flickr oauth access token secret'
|
||||
];
|
||||
$DB->insert_record('user_preferences', $preference);
|
||||
set_user_preferences([
|
||||
'repository_flickr_access_token' => 'dummy flickr oauth access token',
|
||||
'repository_flickr_access_token_secret' => 'dummy flickr oauth access token secret',
|
||||
], $user->id);
|
||||
|
||||
provider::export_user_preferences($user->id);
|
||||
$writer = writer::with_context($contextuser);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue