Part of #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user']

All places in core/lib/Drupal/Core/Authentication/AuthenticationManager.php should be fixed

Files: 
CommentFileSizeAuthor
#9 interdiff.txt2.71 KBjoelpittet
#9 2061953-9-more-global-user-auth-mananger.patch4.21 KBjoelpittet
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#9 2061953-9-more-global-user-auth-mananger.patch4.21 KBjoelpittet
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#3 2061953-3.patch1.36 KBanpolimus
FAILED: [[SimpleTest]]: [MySQL] 58,778 pass(es), 4 fail(s), and 0 exception(s).
[ View ]
#1 2061953-1.patch1.1 KBanpolimus
FAILED: [[SimpleTest]]: [MySQL] 57,793 pass(es), 5 fail(s), and 1 exception(s).
[ View ]

Comments

Issue tags:+CodeSprintCIS
StatusFileSize
new1.1 KB
FAILED: [[SimpleTest]]: [MySQL] 57,793 pass(es), 5 fail(s), and 1 exception(s).
[ View ]

Replaced global $user with $account = $request->attributes->get('_account');

Deleted $user = $account because of it is unneeded now.

Status:Active» Needs review

need review

StatusFileSize
new1.36 KB
FAILED: [[SimpleTest]]: [MySQL] 58,778 pass(es), 4 fail(s), and 0 exception(s).
[ View ]

Deleted $acount getting via services, because this data is generating in this method.

The last submitted patch, 2061953-3.patch, failed testing.

Status:Needs work» Needs review
Issue tags:+CodeSprintCIS

#3: 2061953-3.patch queued for re-testing.

+++ b/core/lib/Drupal/Core/Authentication/AuthenticationManager.php
@@ -83,10 +83,7 @@ public function applies(Request $request) {
-
-    $account = NULL;
-
+    ¶

Not sure you needed to remove the $account = NULL; line and you have some trailing whitespace in the patch.

Other than that everything looks pretty good.

Status:Needs review» Needs work

This is failing as $GLOBALS['user']->isAuthenticated() is used on MaintenanceModeSubscriber.php and test shows isAuthenticated() method is not found.

Assigned:anpolimus» Unassigned
Issue summary:View changes
Status:Needs work» Needs review
Issue tags:-CodeSprintCIS
Parent issue:» #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user']
StatusFileSize
new4.21 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
new4.21 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
new2.71 KB

@sidharthap I don't see that there anymore, but I tried my hand at getting other auth related global users within this area of core. First patch is just more or less a re-roll and the second does a bit more.

The last submitted patch, 9: 2061953-9-more-global-user-auth-mananger.patch, failed testing.

The last submitted patch, 9: 2061953-9-more-global-user-auth-mananger.patch, failed testing.

The last submitted patch, 9: 2061953-9-more-global-user-auth-mananger.patch, failed testing.

The last submitted patch, 9: 2061953-9-more-global-user-auth-mananger.patch, failed testing.

The last submitted patch, 9: 2061953-9-more-global-user-auth-mananger.patch, failed testing.

Re-testing won't help, this can not work. This is the code that actually sets the global user (although it's happening in session.inc too), so obviously no other code must be left that uses global user before this can happen.

Status:Needs review» Postponed

Postponing on the removal everywhere else.