Similar to the problem with the timezone function, this can not work.
session.inc is what provides $user, you can't call currentUser() there, that's a loop.
While it might work for methods that save the session, loading is not going to work. If anything, you'd have to remove the global completely, but that will then again throw off the timezone function. And there are also special cases still for install/update, that call functions in there directly. I suggest this gets postponed on the other conversions, specifically the one that deal with the timezone function (common.inc?, bootstrap.inc).
Currently the authentication happens in \Drupal\user\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance() where $this->account->isAuthenticated() is executed
Comments
Comment #1
jlindsey15 CreditAttribution: jlindsey15 commentedOops that's what I get for copy-pasting a title...
Comment #2
jlindsey15 CreditAttribution: jlindsey15 commentedComment #4
jlindsey15 CreditAttribution: jlindsey15 commentedComment #5
sergeypavlenko CreditAttribution: sergeypavlenko commented#2: rename-global-user-2062771-2.patch queued for re-testing.
Comment #7
jlindsey15 CreditAttribution: jlindsey15 commentedYeah installation is having some errors locally but I'm not really sure why... Ill try to figure it out.
Comment #8
joelpittetRe-rolled #2 with
https://drupal.org/node/2032447 and https://drupal.org/node/2053489
Comment #10
joelpittetSomething's fishy on this one...
Comment #11
joelpittet#8: 2062771-global-user-depricated-session.patch queued for re-testing.
Comment #13
joelpittet8: 2062771-global-user-depricated-session.patch queued for re-testing.
Comment #15
BerdirSimilar to the problem with the timezone function, this can not work.
session.inc is what provides $user, you can't call currentUser() there, that's a loop.
While it might work for methods that save the session, loading is not going to work. If anything, you'd have to remove the global completely, but that will then again throw off the timezone function. And there are also special cases still for install/update, that call functions in there directly. I suggest this gets postponed on the other conversions, specifically the one that deal with the timezone function (common.inc?, bootstrap.inc).
Comment #16
joelpittetGladly, I'll postpone the remaining items as they are likely all related. Which issue shall I postpone them on? This one maybe #1858196: [meta] Leverage Symfony Session components?
Comment #17
joelpittet8: 2062771-global-user-depricated-session.patch queued for re-testing.
Comment #19
ianthomas_ukPostponed on #1858196: [meta] Leverage Symfony Session components
Comment #20
andypostCurrently the authentication happens in
\Drupal\user\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance()
where$this->account->isAuthenticated()
is executedComment #21
almaudoh CreditAttribution: almaudoh commentedAfter #2228341: Objectify session management functions + remove session.inc, session.inc was moved to SessionManager, so re-titling
Comment #22
BerdirSee #2328645: Remove remaining global $user, closing as duplicate of that.