diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 21d3b9e..ccca313 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -368,9 +368,9 @@ function shortcut_toolbar() { $items['shortcuts'] = [ '#cache' => [ 'contexts' => [ - // Cacheable per user, because each user can have his own shortcut set, - // even if he cannot create or select a shortcut set, because an - // administrator may have assigned a non-default shortcut set. + // Cacheable per user, because each user can have their own shortcut + // set, even if they cannot create or select a shortcut set, because + // an administrator may have assigned a non-default shortcut set. 'user', ], ], diff --git a/core/modules/user/user.module b/core/modules/user/user.module index b176e6d..ad8a401 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -4,6 +4,7 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\Unicode; use Drupal\Core\Asset\AttachedAssetsInterface; +use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Form\FormStateInterface; @@ -1375,7 +1376,7 @@ function user_toolbar() { 'contexts' => [ // Cacheable per "authenticated or not", because the links to // display depend on that. - 'user.roles:authenticated', + Cache::mergeContexts('user.roles:authenticated', $links_cache_contexts), ], ], '#theme' => 'links__toolbar_user', @@ -1383,9 +1384,6 @@ function user_toolbar() { '#attributes' => array( 'class' => array('toolbar-menu'), ), - '#cache' => [ - 'contexts' => $links_cache_contexts, - ], ), ), '#weight' => 100,