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;
Comments
Comment #1
sergeypavlenko commentedComment #2
sergeypavlenko commentedFix. Needs review.
Comment #3
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 commentedFix. Thank you!
Comment #7
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 commentedIssue #2062151: Create a current user service to ensure that current account is always available. Fix.
Comment #11
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) commentedEdit desc.