Thanks for working on this @m1r1k! This needs another reroll, the patch applies with the `patch` command but not with `git apply`. Testbot uses `git apply`.
+++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php
@@ -139,7 +139,8 @@ public function getTopics($tid) {
+ $user = $user = Drupal::currentUser();
This one and the above in the ForumManager class should be \Drupal:: since they are within a namespaced class and we don't "use Drupal". That would likely explain the test failures. See https://drupal.org/node/1353118 for more information.
Comments
Comment #1
danylevskyiComment #2
m1r1k CreditAttribution: m1r1k commentedRerolling after #2062151: Create a current user service to ensure that current account is always available:
Comment #3
m1r1k CreditAttribution: m1r1k commentedFor easier trakcing
Comment #4
danylevskyiLooks good!
Comment #5
alexpottpatch no longer applies.
Comment #6
m1r1k CreditAttribution: m1r1k commentedPush to retesting
Comment #7
m1r1k CreditAttribution: m1r1k commented#2: forum-remove-global-user-from-forum-module-2061935-2.patch queued for re-testing.
Comment #9
m1r1k CreditAttribution: m1r1k commentedRerolled
Comment #11
star-szrThanks for working on this @m1r1k! This needs another reroll, the patch applies with the `patch` command but not with `git apply`. Testbot uses `git apply`.
Just one $user = :)
This one and the above in the ForumManager class should be \Drupal:: since they are within a namespaced class and we don't "use Drupal". That would likely explain the test failures. See https://drupal.org/node/1353118 for more information.
Comment #12
m1r1k CreditAttribution: m1r1k commentedOh, my fault. "Haste makes waste" ... @Cottser, thank you for corrections.
Fixed
Comment #13
m1r1k CreditAttribution: m1r1k commentedComment #14
star-szrI'm seeing a couple other conversions are using this in OO code, but I really don't know which is the correct/preferred method.
Comment #15
m1r1k CreditAttribution: m1r1k commented@Cotteser, afaik such code is using inside some OO code that have its own container, like Tests or some plugins which injects container directly.
Comment #16
m1r1k CreditAttribution: m1r1k commentedRe-roll after deciding use '\Drupal' everywhere
Comment #18
m1r1k CreditAttribution: m1r1k commented#16: forum-remove-global-user-from-forum-module-2061935-16.patch queued for re-testing.
Comment #19
joelpittetApplies, passes testbot and replaces all within the module. Ready to go, thanks @m1r1k!
Comment #20
joelpittetWell it doesn't apply any more :S so reroll attached. Someone else to review.
Comment #21
joelpittetback to RTBC, patch still passes after re-roll.
Comment #22
alexpottCommitted ba69ad0 and pushed to 8.x. Thanks!