Loading core/modules/contextual/contextual.module +15 −17 Original line number Diff line number Diff line Loading @@ -108,11 +108,6 @@ function contextual_help($route_name, RouteMatchInterface $route_match) { * @see \Drupal\contextual\ContextualController::render() */ function contextual_preprocess(&$variables, $hook, $info) { $variables['#cache']['contexts'][] = 'user.permissions'; if (!\Drupal::currentUser()->hasPermission('access contextual links')) { return; } // Determine the primary theme function argument. if (!empty($info['variables'])) { $keys = array_keys($info['variables']); Loading @@ -126,6 +121,8 @@ function contextual_preprocess(&$variables, $hook, $info) { } if (isset($element) && is_array($element) && !empty($element['#contextual_links'])) { $variables['#cache']['contexts'][] = 'user.permissions'; if (\Drupal::currentUser()->hasPermission('access contextual links')) { // Mark this element as potentially having contextual links attached to it. $variables['attributes']['class'][] = 'contextual-region'; Loading @@ -140,6 +137,7 @@ function contextual_preprocess(&$variables, $hook, $info) { ]; } } } /** * Implements hook_contextual_links_view_alter(). Loading Loading
core/modules/contextual/contextual.module +15 −17 Original line number Diff line number Diff line Loading @@ -108,11 +108,6 @@ function contextual_help($route_name, RouteMatchInterface $route_match) { * @see \Drupal\contextual\ContextualController::render() */ function contextual_preprocess(&$variables, $hook, $info) { $variables['#cache']['contexts'][] = 'user.permissions'; if (!\Drupal::currentUser()->hasPermission('access contextual links')) { return; } // Determine the primary theme function argument. if (!empty($info['variables'])) { $keys = array_keys($info['variables']); Loading @@ -126,6 +121,8 @@ function contextual_preprocess(&$variables, $hook, $info) { } if (isset($element) && is_array($element) && !empty($element['#contextual_links'])) { $variables['#cache']['contexts'][] = 'user.permissions'; if (\Drupal::currentUser()->hasPermission('access contextual links')) { // Mark this element as potentially having contextual links attached to it. $variables['attributes']['class'][] = 'contextual-region'; Loading @@ -140,6 +137,7 @@ function contextual_preprocess(&$variables, $hook, $info) { ]; } } } /** * Implements hook_contextual_links_view_alter(). Loading