Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
All places in core/modules/system.module should be fixed.
Replace all global $user
and $GLOBALS['user']
. All places in system module should be fixed (except tests see #2150869: Remove calls to deprecated global $user in system module Tests).
Comment | File | Size | Author |
---|---|---|---|
#16 | system-remove-global-user-first-part-2062211-16.patch | 1.87 KB | rych |
#14 | system-remove-global-user-first-part-2062211-14.patch | 6.19 KB | rych |
#6 | 2062211-6-global-user-system.patch | 8.33 KB | joelpittet |
#6 | interdiff.txt | 6.59 KB | joelpittet |
#4 | system-remove-global-user-first-part-2062211-4.patch | 2.66 KB | m1r1k |
Comments
Comment #1
dstorozhukRemoved calls in functions:
Comment #3
m1r1k CreditAttribution: m1r1k commentedHere is a patch. It includes only part of changes, because almost all tests include session usages, that is not ready for current_user yet:
Comment #4
m1r1k CreditAttribution: m1r1k commentedRe-roll after #2053489: Standardize on \Drupal throughout core:
Comment #5
joelpittetShouldn't this be
$user = \Drupal::currentUser();
as well? I could be totally wrong, in that case this is ready.Comment #6
joelpittetSeems to work locally for that so i'm posting. Also there was a few more spots needing attention.
Comment #8
joelpittet#6: 2062211-6-global-user-system.patch queued for re-testing.
Comment #10
joelpittet6: 2062211-6-global-user-system.patch queued for re-testing.
Comment #12
joelpittet6: 2062211-6-global-user-system.patch queued for re-testing.
Comment #14
rych CreditAttribution: rych commentedThe code has changed since #6 patch.
Comment #16
rych CreditAttribution: rych commentedTest files need global $user variable: "NOTE: The global $user variable still exists as it is necessary for certain portions of the installer and simpletest..."
Modified files:
Comment #17
joelpittet@rych cool you got it green!
For the ones in test files, what can we do with them? Do they need a follow-up issue to swing around once the rest are complete or do they need to be rewritten somehow?
Comment #18
joelpittetOk moved the tests conversion task to it's own issue so this one is ready to go #2150869: Remove calls to deprecated global $user in system module Tests
Comment #19
catchCommitted/pushed to 8.x, thanks!