Commit ec7cdc97 authored by alexpott's avatar alexpott

Issue #2061907 by danylevskyi, m1r1k: Remove calls to deprecated global $user in shortcut module.

parent ded8dc77
......@@ -133,7 +133,7 @@ function shortcut_set_switch_validate($form, &$form_state) {
* Submit handler for shortcut_set_switch().
*/
function shortcut_set_switch_submit($form, &$form_state) {
global $user;
$user = \Drupal::currentUser();
$account = $form_state['values']['account'];
if ($form_state['values']['set'] == 'new') {
......
......@@ -303,7 +303,7 @@ function shortcut_set_unassign_user($account) {
*/
function shortcut_current_displayed_set($account = NULL) {
$shortcut_sets = &drupal_static(__FUNCTION__, array());
global $user;
$user = \Drupal::currentUser();
if (!isset($account)) {
$account = $user;
}
......@@ -340,7 +340,7 @@ function shortcut_current_displayed_set($account = NULL) {
* An object representing the default shortcut set.
*/
function shortcut_default_set($account = NULL) {
global $user;
$user = \Drupal::currentUser();
if (!isset($account)) {
$account = $user;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment