Problem/Motivation
As of #2347799: Remove bugged session-related methods from AccountInterface the AccountInterface does not have any session related methods anymore. In addition #2345611: [pp-1] Load user entity in Cookie AuthenticationProvider instead of using manual queries removes the usage UserSession from production code entirely.
Proposed resolution
Move the AccountInterface and AnonymousUser to \Drupal\Core\Authentication interface. Replace UserSession with a User entity in the remaining test code.
Remaining tasks
approve change
commit
User interface changes
no
API changes
- Move
\Drupal\Core\Session\AccountInterfaceto\Drupal\Core\Authentication\AccountInterface, but leave a deprecated subinterface thereof at the old place. - Move
\Drupal\Core\Session\AnonymousUserSessionto\Drupal\Core\Authentication\AnonymousUser. - Remove
\Drupal\Core\Session\UserSessionand replace it with user entity #2345611: [pp-1] Load user entity in Cookie AuthenticationProvider instead of using manual queries. - Move
\Drupal\Core\Session\AccountProxyto\Drupal\Core\Authentication\AccountProxy - Move
\Drupal\Core\Session\AccountSwitcherto\Drupal\Core\Authentication\AccountSwitcher
Follow-up to #2347799: Remove bugged session-related methods from AccountInterface
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | 2477213-account-core-17.patch | 302.22 KB | mgifford |
Comments
Comment #1
znerol commentedComment #2
znerol commentedComment #3
andypostmaybe just update some records
Comment #4
jibranComment #5
andypostWIP phpstorm "move" refactoring
Comment #7
andypostmove
AnonymousUserSessionand related testPlus fix
AccountProxyInterfaceComment #9
andypostSomehow file was not moved
Comment #10
andypost262k and green, suppose we need feedback from commiter and separate issue for
UserSessionremovalComment #11
znerol commentedComment #12
dawehnerIn case we want to do that, I would propose to keep the current interface as alias for the new one. Its IMHO not worth to break that much contrib/custom code.
Comment #13
andypostImplement BC wrappers and move proxy and switcher
Working on rename
AnonymousUserComment #15
andypostFix usage
Comment #16
andypostrename
AnonymousUserSessiontoAnonymousUserComment #17
andyposta bit of clean-up
Comment #18
dawehnerIMHO its not something worth breaking before 8.0.0, given how many instances of AccountInterface are probably out there.
Comment #19
andypostI think there's enough time before release to allow contrib to clean-up usage
Anyway it needs commiters to decide
Comment #20
catchYes there are enough usages of this in contrib we should keep bc here and deprecate for 9.0.0.
Comment #21
cilefen commentedThis needs a beta evaluation. The fact that a committer has evaluated it should help.
Comment #22
jaimeguzman commentedI'm working on this issue, also I used refactor with Phpstorm, it was really easy and validate each namesapce,(like patch comment on #13 and #17). I ran some local test and all to them passed, but I have some doubt about 2 things:
Comment #23
andypostrelated could add new
getDisplayName()method to accountComment #24
Crell commentedThis isn't WSCCI. Also not a 8.0-safe change.
Comment #26
mgiffordRe-uploading #17 for the bots.
Comment #42
znerol commentedNeeds a reroll for 11.x. I'll stick around for reviews here. Find me in the sky lounge at DDD vienna if there are any questions.
Comment #43
andypostnot sure it still makes sense as very disruptive
Comment #45
andypostone more method is moved #3228209: Move hasRole() method from UserInterface to AccountInterface