Skip to:
Content
Pages
Categories
Search
Top
Bottom

Wrong user count


  • Elias
    Member

    @goebelmasse

    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.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Elias
    Member

    @goebelmasse

    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_usermeta there should be used either select count(*) from wordpress_users or select count(distinct user_id) from wordpress_usermeta to 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.


    Elias
    Member

    @goebelmasse

    Arrgh! Horrors!

    The problem is caused by the bb_append_meta invocation in line 2075 of functions.php. The query destroys the last SQL_CALC_FOUND_ROWS and so the count is wrong. A quick and dirty workaround is to change 'append_meta' => false to 'append_meta' => false in the $defaults array in line 2021 of functions.php. But this only works if the append_meta argument is not given in the bb_user_search call.

    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.

    I would not have that expectation unless you report a bug in the trac site.

    http://trac.bbpress.org

    Login with the same details you use here.


    Elias
    Member

    @goebelmasse

    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”…

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar