Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443205
Commits
22835842
Commit
22835842
authored
10 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2312657
by olli: Remove _toolbar_clear_user_cache().
parent
5afbef95
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/toolbar/toolbar.module
+1
-44
1 addition, 44 deletions
core/modules/toolbar/toolbar.module
with
1 addition
and
44 deletions
core/modules/toolbar/toolbar.module
+
1
−
44
View file @
22835842
...
...
@@ -525,39 +525,11 @@ function _toolbar_get_subtrees_hash($langcode) {
// caches later, based on the user's ID regardless of language.
// Clear the cache when the 'locale' tag is deleted. This ensures a fresh
// subtrees rendering when string translations are made.
\Drupal
::
cache
(
'toolbar'
)
->
set
(
$cid
,
$hash
,
Cache
::
PERMANENT
,
array
(
'user'
=>
array
(
$uid
),
'locale'
=>
TRUE
,
'menu'
=>
'admin'
));
\Drupal
::
cache
(
'toolbar'
)
->
set
(
$cid
,
$hash
,
Cache
::
PERMANENT
,
array
(
'user'
=>
array
(
$uid
),
'locale'
=>
TRUE
,
'menu'
=>
'admin'
,
'user_roles'
=>
TRUE
));
}
return
$hash
;
}
/**
* Implements hook_modules_installed().
*/
function
toolbar_modules_installed
(
$modules
)
{
_toolbar_clear_user_cache
();
}
/**
* Implements hook_modules_uninstalled().
*/
function
toolbar_modules_uninstalled
(
$modules
)
{
_toolbar_clear_user_cache
();
}
/**
* Implements hook_ENTITY_TYPE_update() for user entities.
*/
function
toolbar_user_update
(
UserInterface
$user
)
{
_toolbar_clear_user_cache
(
$user
->
id
());
}
/**
* Implements hook_ENTITY_TYPE_update() for user_role entities.
*/
function
toolbar_user_role_update
(
RoleInterface
$role
)
{
_toolbar_clear_user_cache
();
}
/**
* Returns a cache ID from the user and language IDs.
*
...
...
@@ -573,18 +545,3 @@ function _toolbar_get_user_cid($uid, $langcode) {
return
'toolbar_'
.
$uid
.
':'
.
$langcode
;
}
/**
* Clears the Toolbar user cache.
*
* @param int $uid
* (optional) The user ID whose toolbar cache entry to clear.
*/
function
_toolbar_clear_user_cache
(
$uid
=
NULL
)
{
// Clear by the 'user' tag in order to delete all caches, in any language,
// associated with this user.
if
(
isset
(
$uid
))
{
Cache
::
deleteTags
(
array
(
'user'
=>
array
(
$uid
)));
}
else
{
\Drupal
::
cache
(
'toolbar'
)
->
deleteAll
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment