Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
According to #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user'] we correct this module.
Comments
Comment #1
victor-shelepen CreditAttribution: victor-shelepen commentedI've done small modifications.
Comment #2
victor-shelepen CreditAttribution: victor-shelepen commentedComment #3
victor-shelepen CreditAttribution: victor-shelepen commentedI 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.
It had been removed because the user initialized few lines beneath.
Comment #4
victor-shelepen CreditAttribution: victor-shelepen commentedFixed. It works by manual testing. I see the language module also has problems with tests.
Comment #5
Gábor HojtsyThis looks very straightforward and all are in global functions, so global invocation of Drupal::* is appropriate.
Comment #6
Gábor HojtsyWait, 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.
Comment #7
Gábor HojtsyComment #8
victor-shelepen CreditAttribution: victor-shelepen commentedSorry. This #2, #4 are my mistakes.
Comment #9
victor-shelepen CreditAttribution: victor-shelepen commentedComment #11
jair CreditAttribution: jair commentedComment #12
pfrenssen#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.
Comment #13
Gábor HojtsyLooks good as per above discussion.
Comment #14
catchPostponing on #2062151: Create a current user service to ensure that current account is always available
Comment #15
Gábor Hojtsy#2062151: Create a current user service to ensure that current account is always available landed. This should now use the current_user service.
Comment #16
sergeypavlenko CreditAttribution: sergeypavlenko commentedComment #18
m1r1k CreditAttribution: m1r1k commentedTry with this patch #2076411: Remove the request scope from the current user service
Comment #19
sergeypavlenko CreditAttribution: sergeypavlenko commentedNew patch.
Comment #20
sergeypavlenko CreditAttribution: sergeypavlenko commentedComment #21
andypostlet's postpone on it
outdated
Comment #22
m1r1k CreditAttribution: m1r1k commentedAdd tag for easy tracking
Comment #23
joelpittetRe-rolled without the
scope: request
bit from #19Comment #24
joelpittetDidn't mean to remove the blocked-by-request-scope tag
Comment #25
Gábor HojtsyAs per above.
Comment #26
webchickCommitted and pushed to 8.x. Thanks!