improbable_airtime
Member
I'm in the process of building an app with Laravel that works in-hand with XenForo.
The issue is that in my use-case, I have a webhook that communicates with my server and I create a Job and run it with a worker. When that webhook is processed, I want it to give the context user a certain usergroup on the forum. However, it would appear to just not work whenever the webhook since whenever the job gets processed, it does everything (fair amount of other code), EXCEPT adding the usergroup. This is incredibly frustrating since there are no errors, no logs, and from my own personal debugging, there are no silly mistakes such as undefined variables etc...
So I've got no idea what the issue is and what makes it even more frustrating is that if I make something like some buttons for adding/removing usergroups in my application, those work FLAWLESSLY using exactly the same functions. But as soon as it's inside a Job, it breaks.
So my current theory is that somehow, the job is ending before
My current code is as follows;
Hopefully someone can help me out.
The issue is that in my use-case, I have a webhook that communicates with my server and I create a Job and run it with a worker. When that webhook is processed, I want it to give the context user a certain usergroup on the forum. However, it would appear to just not work whenever the webhook since whenever the job gets processed, it does everything (fair amount of other code), EXCEPT adding the usergroup. This is incredibly frustrating since there are no errors, no logs, and from my own personal debugging, there are no silly mistakes such as undefined variables etc...
So I've got no idea what the issue is and what makes it even more frustrating is that if I make something like some buttons for adding/removing usergroups in my application, those work FLAWLESSLY using exactly the same functions. But as soon as it's inside a Job, it breaks.
So my current theory is that somehow, the job is ending before
addUserGroupChange
and any other methods it depends on in XF finish.My current code is as follows;
Code:
$service = Xenforo::getApp()->service('XF:User\UserGroupChange');
$service->addUserGroupChange($this->forum_id, $key,
$groups->toArray());
Hopefully someone can help me out.