Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anpolimus’s picture

Issue tags: +CodeSprintCIS
FileSize
1.1 KB

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

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

anpolimus’s picture

Status: Active » Needs review

need review

anpolimus’s picture

FileSize
1.36 KB

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

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

joelpittet’s picture

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

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

joelpittet’s picture

+++ 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.

joelpittet’s picture

Status: Needs review » Needs work
sidharthap’s picture

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

joelpittet’s picture

@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.

joelpittet’s picture

joelpittet’s picture

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.

Berdir’s picture

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.

xjm’s picture

Status: Needs review » Postponed

Postponing on the removal everywhere else.

Berdir’s picture

Status: Postponed » Closed (duplicate)

See #2328645: Remove remaining global $user, closing as duplicate of that.