Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
22835842
Commit
22835842
authored
Aug 6, 2014
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2312657
by olli: Remove _toolbar_clear_user_cache().
parent
5afbef95
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show 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