Closed slifty closed 2 years ago
It seems that the group is populated here
I'm not completely sure why this isn't working yet, but it is worth noting that this code is ultimately is using an outdated way of accessing user ($wgUser) <-- this has been deprecated, and has a warning that it shouldn't be used in new code.
That page also explains that wgUser is populated pretty late in the initialization process, and if a hook is called before it is populated, the user won't always have valid information. Again, I'm not sure if this is the actual issue BUT it could potentially explain the unpredictable nature of this bug -- where sometimes group is populated properly and other times it is not, even for the same user.
One initial thing I want to try is instead using $parser->getUser()
instead of $wgUser
.
Worst case it fixes nothing, but at least it isn't using that particular deprecated aspect.
Another item is that later in the code we use $user->getGroups()
which is deprecated as of 1.35
Apparently we are supposed to instead use UserGroupManager::getUserGroups().
I'm going to close this as stale -- I do think a warning sometimes shows up in logs but it isn't related to functionality at this point. We can re-open / make a new issue if we want to take that one later.
There is a recurring 500 error in the logs (since at least May 15th) which looks something like:
You'll notice that there is no
group
defined in the request URL; we need to figure out why and correct the issue.