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.
All places in Comment module should replace global $user
and $GLOBALS['user']
.
Comment | File | Size | Author |
---|---|---|---|
#34 | 2061899-34-global-user-comment.patch | 4.69 KB | joelpittet |
#32 | 2061899-32-global-user-comment.patch | 4.66 KB | joelpittet |
#19 | 2061899-19-global-user-comment.patch | 3.7 KB | joelpittet |
#19 | interdiff.txt | 5.39 KB | joelpittet |
#18 | interdiff.txt | 1.59 KB | joelpittet |
Comments
Comment #1
m1r1k CreditAttribution: m1r1k commentedHere is the patch
Comment #2
m1r1k CreditAttribution: m1r1k commentedRemoved '\' form functional code
Depends on #2062051: The request does not contain the _account on comment permalink pages
Comment #4
yanniboi CreditAttribution: yanniboi commentedThis is where the BCDecorator Test fails.
After debugging I fount the '_account' is not among the attributes (only parameters is available..). Not sure how to fix it, but I thought I'd post what I've found.
Comment #5
yanniboi CreditAttribution: yanniboi commentedLooks like the ENTITY CRUD HOOKS test fails for the same reason.
Comment #6
andypostProbably this one should use Drupal::currentUser()
Comment #7
m1r1k CreditAttribution: m1r1k commentedRerolling after #2062151: Create a current user service to ensure that current account is always available. Also using this small but important fix - #2076411: Remove the request scope from the current user service
Comment #8
andypostonly questionable because better to inject this service
Comment #10
m1r1k CreditAttribution: m1r1k commentedSeems it depends on patches for #2061935: Remove calls to deprecated global $user in forum module, #2078057: Remove references to global $user in Content Translation module and other similar issues.
Comment #11
joelpittetRe-rolled #7
Comment #13
joelpittetcurious about @m1r1k said in #10 so I applied both of those patches to #11 to see what testbot does.
This is a test only. Use #11 for the basis of any future patches/rerolls.
Comment #14
joelpittetComment #16
joelpittetChanged for this: #2053489: Standardize on \Drupal throughout core
Probably will still break.
Comment #18
joelpittetI think I got some extra stuff in the last so I undid that content_translation stuff and shuffled some stuff around a bit to see if I can get some better results.
Comment #19
joelpittetbetter interdiff.
Comment #21
joelpittet#19: 2061899-19-global-user-comment.patch queued for re-testing.
Comment #22
joelpittet#18: 2061899-18-global-user-comment.patch queued for re-testing.
Comment #24
joelpittet18 and 19 are identical but there are two more fails:S I retested both and same diff.
Comment #25
joelpittet19: 2061899-19-global-user-comment.patch queued for re-testing.
Comment #26
joelpittet18: 2061899-18-global-user-comment.patch queued for re-testing.
Comment #28
joelpittet19: 2061899-19-global-user-comment.patch queued for re-testing.
Comment #30
joelpittet19: 2061899-19-global-user-comment.patch queued for re-testing.
Comment #32
joelpittetRe-roll
Comment #33
areke CreditAttribution: areke commentedThis doesn't apply anymore; it needs to be re-rolled again.
Comment #34
joelpittetRe-rolled again.
Comment #35
ryantremblay CreditAttribution: ryantremblay commentedLooks good. Passes test bot.
Comment #36
areke CreditAttribution: areke commentedRTBC'd again.
Comment #37
webchickCommitted and pushed to 8.x. Thanks!