Skip to:
Content
Pages
Categories
Search
Top
Bottom

Replies not showing in backend & strange issue with froums\topics


  • mmice
    Participant

    @mmice

    Hello! I’ve been importing forum from phpBB *the v.1, so converters are not working for me and i’m working through the database.
    Well, – forums are showing, so do topics, – when i click on “Replies” in admin – i get no response from server. Yep, there’re about 7,5M replies there, but i guess it has to work despite of that fact?
    Those replies are shown in frontend and forums seem to work well.

    Another issue is: as i imported forums and topics to db – i could see them both listed at backend and frontend. But if i tried to come into the forum or topic on frontend i’ve got “not found”.
    Open forum in backend, then just “save” helped that.
    Bulk select topics, edit, changing nothing, just “save” helped that.

    What could be the reason? I couldn’t find any changes in _posts table @db. Maybe bbpress uses some other tables for it? Just couldn’t find it out.

Viewing 9 replies - 26 through 34 (of 34 total)

  • mmice
    Participant

    @mmice

    I really appreciate!

    Yep, it’s likely php script code limitation. I already asked for admin’s to encrease php_time_limit, but it’s still to small ))

    Found the patch, it needs lots of testing and I haven’t had the time to take even a cursory look at it yet https://bbpress.trac.wordpress.org/ticket/2731, so lets leave that aside for now.

    The code is here, I’m not sure your level of PHP knowledge but I’ll just add the link to it for now and will follow up after you’ve had a look at the code:
    https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/admin/tools.php#L1134


    mmice
    Participant

    @mmice

    Well, i ran:

    SELECT a.ID FROM bb_posts AS a
    INNER JOIN (
     SELECT menu_order, post_parent
     FROM bb_posts
     GROUP BY menu_order, post_parent
     HAVING COUNT( * ) >1
    )b
     ON a.menu_order = b.menu_order
     AND a.post_parent = b.post_parent
     WHERE post_type = 'reply';

    3,763,193 total, Query took 11.5215 sec
    I guess it’s only SELECT and yep, it returns what is have to be fixed?
    Script seems to make “bbp_update_reply_position” with that information. Where can i find the reply position in DB?

    Two functions bbp_update_reply_position() and bbp_get_reply_position_raw() are what you need to look at:
    https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/replies/functions.php#L2113
    https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/replies/functions.php#L2149

    The two functions above are what calculates the reply position in the database as it doesn’t actually exist in the database until either a) a new reply is added to a topic or b) the repair tool is ran to calculate the reply order.

    You could also try running that same query you did above where it returned 3,763,193 total replies, then run the repair reply menu order repair tool and run the query again then subtract that new total from the original 3,763,193 to see how many replies are getting there menu order updated before PHP times out, then divide 3,763,193 by that number and you’d have a theoretical value of how many times you would need to run that tool before all replies are actually repaired 😉


    mmice
    Participant

    @mmice

    Hmmm, yep, i see.
    The question is where i can find reply positions in DB? Or where they should appear, if none.
    Maybe i’m blind a bit, but cannot find such a field in _posts table.


    mmice
    Participant

    @mmice

    3,763,193 total still.. Seems it doesn’t repair any.
    I guess it stucks on “select” query, and so just doen’t start to update.

    The reply position is stored in wp_posts in menu_order, the first reply of a topic should be 0, then each reply after that increments by 1, that is what the end goal should be.

    Another potential idea would be to modify the code to “limit” the repair tool amount of replies it’s trying to do each time.

    I’m not sure how many forums your site has, but maybe restricting that by forum ID may drop you down from 3 million to something more reasonable to process in under 30 seconds?

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