Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user']
core/modules/file/file.module:
function file_validate_size(File $file, $file_limit = 0, $user_limit = 0) {
global $user;
function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAME) {
global $user;
function file_file_download($uri, $field_type = 'file') {
global $user;
function file_save_upload($form_field_name, $validators = array(), $destination = FALSE, $delta = NULL, $replace = FILE_EXISTS_RENAME) {
global $user;
core/modules/file/lib/Drupal/file/Tests/ValidatorTest.php:
function testFileValidateSize() {
global $user;
Comment | File | Size | Author |
---|---|---|---|
#10 | drupal8.file-system.2061895-10.patch | 2.13 KB | sergeypavlenko |
#7 | drupal-2061895-7.patch | 2.25 KB | sergeypavlenko |
#5 | 2061895-5.patch | 2.31 KB | sergeypavlenko |
#3 | drupal-2061895-3.patch | 4.09 KB | sergeypavlenko |
#2 | remove-calls-to-deprecated-global-user-in-file-module-2061895-2.patch | 4.09 KB | sergeypavlenko |
Comments
Comment #1
sergeypavlenko CreditAttribution: sergeypavlenko commentedComment #2
sergeypavlenko CreditAttribution: sergeypavlenko commentedFix. Needs review.
Comment #3
sergeypavlenko CreditAttribution: sergeypavlenko commentedRemoved \ with some functions.
Comment #4
andypostPlease do not change the variable name. Leave $user as it was
This should be $this->container->get('request')->....
Comment #5
sergeypavlenko CreditAttribution: sergeypavlenko commentedFix. Thank you!
Comment #7
sergeypavlenko CreditAttribution: sergeypavlenko commentedFix.
Comment #8
andypostNice
Comment #9
catchSorry postponing this on #2062151: Create a current user service to ensure that current account is always available.
Comment #10
sergeypavlenko CreditAttribution: sergeypavlenko commentedIssue #2062151: Create a current user service to ensure that current account is always available. Fix.
Comment #11
Crell CreditAttribution: Crell commented#10 looks correct to me, pending bot approval.
Comment #12
alexpottCommitted aafee28 and pushed to 8.x. Thanks!
Comment #13.0
(not verified) CreditAttribution: commentedEdit desc.