Info
- 5 posts
- 2 voices
- Started 4 years ago by Elias
- Latest reply from Elias
- This topic is resolved
Wrong user count
-
- Posted 4 years ago #
I use bbPress 0.8.2.1 for a small forum. My user table is shared with a wordpress blog. My bbPress plugins are UseDisplayName 0.7.2, AllowImages 0.7.1, Private Forums 5.0, Forums Moderators 1.0, Google Analytics 0.68. I use the german localisation file, it is a german forum.
There is a strange bug in the user list. At the moment, 8 users are registered. But the Users/Find admin panel displays a wrong number of users. It says there are 61 users.
I took a screenshot a few days ago with six users, displayed as 48, if you don't understand the problem, take a look in my weird numbers. And I thought that reckoning is something a computer can do.
Is the problem caused by one of my plugins, or by another reason? And is there a workaround? It is a bug that does not harm me now, but it is a strange one I do not understand.
-
- Posted 4 years ago #
I found something that can help to fix this bug. In the following I use wordpress_ as prefix for my WP tables.
My wordpress_usermeta table has 65 rows, and 65 users are displayed now in the bbPress dashboard. It seems to be a wrong SQL statement for querying the number of users.
Instead of the (by me assumed)
select count(*) from wordpress_usermetathere should be used eitherselect count(*) from wordpress_usersorselect count(distinct user_id) from wordpress_usermetato get the number of users.(Oh yes, I know that there will be a where-clause...)
I suspect line 2046 in
bb-includes/functions.php, but I'm not familar with the source. -
- Posted 4 years ago #
Arrgh! Horrors!
The problem is caused by the
bb_append_metainvocation in line 2075 offunctions.php. The query destroys the lastSQL_CALC_FOUND_ROWSand so the count is wrong. A quick and dirty workaround is to change'append_meta' => falseto'append_meta' => falsein the$defaultsarray in line 2021 offunctions.php. But this only works if the append_meta argument is not given in thebb_user_searchcall.Now the problem is more complicated as I suspected earlier. It is a problem for the hackers that make bbPress. No further searching for bugs from me, the problem should be clear. (It is clear enough to me after reading lots of code from other people.) I expect it to be fixed in the next release.
-
- Posted 4 years ago #
I would not have that expectation unless you report a bug in the trac site.
Login with the same details you use here.
-
- Posted 4 years ago #
Oh, thank you SamBauers - this is the information missing on this site...
But as I read at the trac site, the problem is already known. It is fixed by changeset 867 - at least in my test environment. I'll upload it to the real server, it seems to be okay and of course it will be better than my quick and dirty "solution"...
-
You must log in to post.