Files: 
CommentFileSizeAuthor
#23 2061923-23-global-user-locale.patch1.78 KBjoelpittet
PASSED: [[SimpleTest]]: [MySQL] 58,802 pass(es).
[ View ]
#19 drupal8.locale-module.2061923-19.patch2.17 KBsergeypavlenko
PASSED: [[SimpleTest]]: [MySQL] 58,141 pass(es).
[ View ]
#16 drupal8.locale-module.2061923-16.patch1.76 KBsergeypavlenko
FAILED: [[SimpleTest]]: [MySQL] 58,061 pass(es), 132 fail(s), and 46 exception(s).
[ View ]
#12 locale-global_user_var-2061923-12.patch1.79 KBpfrenssen
PASSED: [[SimpleTest]]: [MySQL] 58,031 pass(es).
[ View ]
#9 language-global_user_var-2061929-1.patch1.77 KBlikin
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch language-global_user_var-2061929-1_1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 language-global_user_var-2061929-1.patch1.77 KBlikin
PASSED: [[SimpleTest]]: [MySQL] 58,002 pass(es).
[ View ]
#2 locale-global_user_var-2061923-2.patch1.79 KBlikin
PASSED: [[SimpleTest]]: [MySQL] 57,805 pass(es).
[ View ]
#1 locale-global_user_var-2061923-2.patch0 byteslikin
PASSED: [[SimpleTest]]: [MySQL] 58,015 pass(es).
[ View ]

Comments

StatusFileSize
new0 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,015 pass(es).
[ View ]

I've done small modifications.

StatusFileSize
new1.79 KB
PASSED: [[SimpleTest]]: [MySQL] 57,805 pass(es).
[ View ]

Status:Active» Needs review

I was playing with DIC I see that it is a model hidden deep in objects. It is a model. I do not know why we need user roles here.
If we delete this part of the key we will kill our headache.

// for anonymous users.
-    $rids = isset($GLOBALS['user']) ? implode(':', array_keys($GLOBALS['user']->getRoles())) : '0';
+    $user = \Drupal::request()->attributes->get('_account');
+    $rids = $user ? implode(':', array_keys($user->getRoles())) : '0';

// @todo: If the global user is an EntityBCDecorator, getting the roles
-    // from it within LocaleLookup results in a loop that invokes LocaleLookup
-    // again.
-    global $user;
-    $user = drupal_anonymous_user();
-

It had been removed because the user initialized few lines beneath.

$user = $this->drupalCreateUser(array('translate interface', 'access administration pages'));

StatusFileSize
new1.77 KB
PASSED: [[SimpleTest]]: [MySQL] 58,002 pass(es).
[ View ]

Fixed. It works by manual testing. I see the language module also has problems with tests.

Status:Needs review» Reviewed & tested by the community
Issue tags:+D8MI, +sprint, +language-base

This looks very straightforward and all are in global functions, so global invocation of Drupal::* is appropriate.

Status:Reviewed & tested by the community» Needs review

Wait, what! #4 is not a patch for this issue. Haha! Ok so looking at #2, is $user not used inbetween the re-initialization? Can you re-upload #2 which is the relevant patch.

Issue tags:-D8MI-meta

Sorry. This #2, #4 are my mistakes.

StatusFileSize
new1.77 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch language-global_user_var-2061929-1_1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Status:Needs review» Needs work

The last submitted patch, language-global_user_var-2061929-1.patch, failed testing.

Issue tags:+Needs reroll

Status:Needs work» Needs review
Issue tags:-Needs reroll
StatusFileSize
new1.79 KB
PASSED: [[SimpleTest]]: [MySQL] 58,031 pass(es).
[ View ]

#9 is for the Language module, not for the Locale module, see Gábor's comment at #6.

Here's a straight reroll of the patch in #2.

Status:Needs review» Reviewed & tested by the community

Looks good as per above discussion.

Status:Reviewed & tested by the community» Postponed

Status:Postponed» Needs work

Assigned:likin» Unassigned
Status:Needs work» Needs review
StatusFileSize
new1.76 KB
FAILED: [[SimpleTest]]: [MySQL] 58,061 pass(es), 132 fail(s), and 46 exception(s).
[ View ]

Status:Needs review» Needs work

The last submitted patch, drupal8.locale-module.2061923-16.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.17 KB
PASSED: [[SimpleTest]]: [MySQL] 58,141 pass(es).
[ View ]

New patch.

Title:Remove calls to deprecated global $userRemove calls to deprecated global $user in locale module

Status:Needs review» Postponed
  1. +++ b/core/core.services.yml
    @@ -613,7 +613,6 @@ services:
    -    scope: request

    let's postpone on it

  2. +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
    @@ -63,12 +63,6 @@ function testUninstallProcess() {
    -    // @todo: If the global user is an EntityBCDecorator, getting the roles

    outdated

Add tag for easy tracking

Status:Postponed» Needs review
Issue tags:-sprint, -likin, -blocked-by-request-scope
StatusFileSize
new1.78 KB
PASSED: [[SimpleTest]]: [MySQL] 58,802 pass(es).
[ View ]

Re-rolled without the scope: request bit from #19

Didn't mean to remove the blocked-by-request-scope tag

Status:Needs review» Reviewed & tested by the community

As per above.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.