Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Approval getting stuck in endless loading loop in 2.3.1
sudden156
✭✭
When I approve someone's membership under 'Manage Applicants' instead of going straight away to 'Approved' it gets stuck in an endless loop as if loading, yet the approval email in my tests is sent out nonetheless and on reloading the page the approved person has disappeared and is now under Users and Activity. Can anyone suggest what might be going wrong here? Screenshot, static:
:
0
Comments
Sounds like the server is timing out.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Two things:
1. Take a look at the JavaScript console if there are any errors
2. Try to open the "Approve" link in another window by right clicking on it and choosing that option (if possible)
I tried opening the 'Approve' link in another tab and got the 'Something has gone wrong' page.
The JavaScript error would appear to be:
Use of getPreventDefault() is deprecated. Use defaultPrevented instead.
I don't believe I have changed the default 2.3.1 application in any way to have caused this, but I don't know enough about JavaScript to interpret the fault. Any feedback appreciated.
"Something has gone wrong" is targeted for your users: it shouldn't scare them and it shouldn't expose critical information. You can force Vanilla to show more meaningful errors for debugging purposes. Add
$Configuration['Debug'] = TRUE;
to your/conf/config.php
But you have already a JavaScript error. Some file is using a deprecated function:
getPreventDefault
. Your browser already shows you which file is using that function and you should be able to tell which application/theme/plugin is using that fileI get the following fatal error. Any idea how to interpret it?
Fatal Error in UserController.approve();
Requires POST
The error occurred on or near: /home/example/public_html/example.com/example/applications/dashboard/controllers/class.usercontroller.php
265: * @param string $TransientKey Security token.
266: */
267: public function approve($UserID = '') {
268: if (!Gdn::request()->isAuthenticatedPostBack(true)) {
269: throw new Exception('Requires POST', 405);
270: }
271: $this->permission('Garden.Users.Approve');
272:
273: $this->handleApplicant('Approve', $UserID);
Backtrace:
[/home/example/public_html/example.com/example/library/core/class.dispatcher.php:326] UserController->approve();
[/home/example/public_html/example.com/example/index.php:44] Gdn_Dispatcher->dispatch();
Sorry for not being more clearer: you should start with the more obvious JavaScript error since all other errors might only be a result of that error. Which plugin causes that deprecation message?
That's the thing, I can't see as any plugin is causing it, it seems to be a problem in Vanilla itself. Yet I guess it can't be if no-one else is having the problem. So I'm a bit flummoxed.
Yes. For security reasons this action only works if it is initiated by a POST request. Opening it in a new window makes it a GET request. My bad.
Could it be that the JavaScript message is only a hint and no error? I must admit that I'm also a bit out of ideas. Could you provide a screenshot of your JavaScript console with that error?
Ah, right, I thought the fatal error might have been due to that.
Here's the JavaScript Console with that error, and another one now:
Beats me. If that would be my forum, I would open /applications/dashboard/controllers/class.usercontroller.php, search for the following code
and comment out the throw exception line like that
Afterwards I would open the Approve link in a new window, making sure that I have turned on debugging before.
Then, after noting down the error message, I would overwrite that changed file with a copy of the original file.
The risk is that you mess up the file because you are changing something without noticing that. If you work concentrated, that would be no problem.
Another risk is that someone could trick you to click a link which would approve a user while that line is commented. If you only change that file while you are testing and uncommenting that line afterwards, that would be no problem.
But if you make that change and open the file in a new window, I think you will see an error which would be more informative.
I've tried what you suggest and get a debug trace. I'm afraid though that I don't know enough to interpret what it's telling me. Would you mind if I sent it to you as a MHT file?
Just do so, but I'm not sure when I will be able to open it. A Screenshot would be more handy
I've just sent as screenshot.
The wierd thing is that I have a parallel test forum that so far as I know is exactly the same as my live forum and that works fine, despite the same JavaScript error showing up. Perhaps my live forum was corrupted on installation.
On the Screenshots there are only notices, no error messages. So the php side is correct and the Javascript side seems to be correct, too. I have tested the accept functionality on my test forum and it needed a second or two for that loader-bar to disappear. How is the normal response time of your forum? Maybe vrijvlinders assumption was correct and it is only a timeout issue. But in the other hand, you have posted a Screenshot above that has shown the result of the POST call.
No, sorry, I don't have any ideas left...
The loader bar simply doesn't disappear. Normally it would be gone in a second or two. If it's just a timeout it's consistent with the live forum but not with my test forum. But as I say the functionality doesn't seem to be impaired, in that people are being approved and the emails are being sent out nonetheless, so I'll probably just live with it and wait for the next Vanilla version and upgrade soon. Thanks for all your help, much appreciated. If I come up with an answer I'll post it here. Maybe it is one of those things that just resolve themselves in time.