diff --git a/core/core.services.yml b/core/core.services.yml index f941e33..5e0c926 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -613,7 +613,6 @@ services: factory_method: authenticate factory_service: authentication arguments: ['@request'] - scope: request asset.css.collection_renderer: class: Drupal\Core\Asset\CssCollectionRenderer asset.css.collection_optimizer: diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 119f429..8d0b11a 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -278,7 +278,7 @@ function node_title_list($result, $title = NULL) { * One of the MARK constants. */ function node_mark($nid, $timestamp) { - global $user; + $user = Drupal::currentUser(); $cache = &drupal_static(__FUNCTION__, array()); if ($user->isAnonymous() || !module_exists('history')) { @@ -2142,7 +2142,7 @@ function node_permissions_get_configured_types() { function node_access_grants($op, $account = NULL) { if (!isset($account)) { - $account = $GLOBALS['user']; + $account = Drupal::currentUser(); } // Fetch node access grants from other modules. @@ -2176,7 +2176,7 @@ function node_access_grants($op, $account = NULL) { * @see node_query_node_access_alter() */ function node_access_view_all_nodes($account = NULL) { - global $user; + $user = Drupal::currentUser(); if (!$account) { $account = $user; } @@ -2204,7 +2204,7 @@ function node_access_view_all_nodes($account = NULL) { * * This is the hook_query_alter() for queries tagged with 'node_access'. It adds * node access checks for the user account given by the 'account' meta-data (or - * global $user if not provided), for an operation given by the 'op' meta-data + * Drupal::currentUser() if not provided), for an operation given by the 'op' meta-data * (or 'view' if not provided; other possible values are 'update' and 'delete'). * * Queries tagged with 'node_access' that are not against the {node} table @@ -2216,7 +2216,7 @@ function node_access_view_all_nodes($account = NULL) { * @endcode */ function node_query_node_access_alter(AlterableInterface $query) { - global $user; + $user = Drupal::currentUser(); // Read meta-data from query, if provided. if (!$account = $query->getMetaData('account')) {