Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Part of #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user']
All places in views module should be fixed
core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php:
global $user;
core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php:
global $user;
core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php:
global $user;
core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php:
global $user;
core/modules/views/lib/Drupal/views/ViewExecutable.php:
$account = $GLOBALS['user'];
Comments
Comment #1
alphawebgroupComment #1.0
alphawebgroupUpdated issue summary.
Comment #1.1
alphawebgroupUpdated issue summary.
Comment #1.2
alphawebgroupUpdated issue summary.
Comment #2
dawehnerIs there any reason why the request object is not injected?
Comment #3
dawehnerThanks this is looking quite fine!
Is there any reason why the request object is not injected?
Comment #5
alphawebgroup@dawehner
Hi!
really don't have any reason...
I'll try to re-make that patch with injecting of request object
will back soon
Comment #6
dawehnerThank you very much!
Comment #7
alphawebgroupLets separate that issue on plugin-based approach.. just to simplify and to get clear imagination for the scope of work
core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
#2062169: Remove calls to deprecated global $user in views plugin CachePluginBase.php of views module
core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
#2062227: Remove calls to deprecated global $user in views plugin DisplayPluginBase.php of views module
core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
#2062261: Remove calls to deprecated global $user in views plugin FilterPluginBase.php of views module
core/modules/views/lib/Drupal/views/ViewExecutable.php
#2062421: Remove calls to deprecated global $user in ViewExecutable.php of views module
Comment #8
andypostSuppose it's not clear in which cases to use
Drupal::currentUser()
and$request..._account
Drupal::currentUser()
Comment #9
sergeypavlenko CreditAttribution: sergeypavlenko commentedComment #11
sergeypavlenko CreditAttribution: sergeypavlenko commentedDepends on #2076411: Remove the request scope from the current user service.
Comment #12
m1r1k CreditAttribution: m1r1k commentedFor easy tracking
Comment #13
joelpittetPatch doesn't apply anymore. Needs re-roll.
https://drupal.org/patch/reroll
Comment #14
m1r1k CreditAttribution: m1r1k commentedRerolled
Comment #15
joelpittet@m1r1k the bottom of the file looks like extra stuff got added to the reroll some how doubling the patch size. Could you re-roll again?
Comment #16
m1r1k CreditAttribution: m1r1k commentedOh, my fault. Fixed version:
Comment #17
joelpittetThis looks ready to go, passes testbot and very straight forward changes.
Comment #18
catchCommitted/pushed to 8.x, thanks!
Comment #19.0
(not verified) CreditAttribution: commentedUpdated issue summary.