Skip to:
Content
Pages
Categories
Search
Top
Bottom

Permalinks in replies lead to the wrong page

  • @qiwichupa

    Participant

    Hi. I have encountered this problem: after installing bbpress and converting Mingle forum (this operation was not without problems), in some topics some permalinks are generated with wrong pages.

    For example, following this link…:
    mydomain/bbforums/topic/stream-records/page/8#post-121032
    (I deleted the real domain since my thread was marked as spam, but I can provide it below if needed.)

    … we get to page 8 and go down to post 121032 – the second one on that page. But if we go up to the first post on this page, we can see that the link to it is formed as “…/page/7#post-120964″ – as if the post was located on the previous page. Also, if you go down to the bottom of this page, you will see that the last posts are formed as “…/page/9#post-121104″. – that is leading to the next page.

    Of course, I experimented with the settings of the paginator, changed the number of displayed posts on the page. In fact, it didn’t change anything, only the posts with the same error were changed. At the same time, if you do not change the settings of the paginator, a few posts with an incorrect link managed to “cure” by splitting the topic starting from this post, and then connecting the new topic with the previous one. But the above post didn’t work, so we can’t say that this is the solution.

    I suspect that the cause of the problem may be an incorrectly performed forum import operation, but this operation was not easy (all posts were initially converted as replays and I had to manually correct their status in the database, also some posts were duplicated and were in the wrong id-order) and I would like to understand what exactly can cause this problem and how to fix it.

    Of course I’ve already tried bbpress’ built-in error correction options, but they didn’t have any effect.

    It’s strange that the paginator seems to be working correctly – it gives the right number of posts per page, and links to these pages also work correctly, but the permalinks with anchors are not working correctly.

    Maybe someone has encountered a similar problem and can advise in what direction to look for its solution?

    Tech info:
    WordPress Version: 6.8.1
    Current WordPress Theme: Twenty Fourteen/twentyfourteen-garage version 1.2
    PHP Version: 7.4.33
    MySQL Version: 10.6.22-MariaDB-0ubuntu0.22.04.1
    bbPress (2.6.14)
    bbP private groups (3.9.7)
    bbp style pack (6.3.9)

    the last two plugins do not affect the problem, when you turn them off it remains

Viewing 21 replies - 1 through 21 (of 21 total)
  • @robin-w

    Moderator

    so
    is it displaying fine, but just that the links are wrong, or
    is it displaying incorrectly?

    @qiwichupa

    Participant

    Only the links are wrong. The posts themselves are displayed correctly, and their number on the page is correct. But on one page (as in my case – on page 8) there are posts whose links are generated in such a way that they lead to pages 7 and 9, where of course there are no posts with such numbers.

    @qiwichupa

    Participant

    And this problem is not on one page, almost every page has both correct links and links leading to the previous or next page (but with the correct post numbers at that)

    @robin-w

    Moderator

    Do you have reply threading switched on?

    dashboard>settings>forums>Reply Threading

    @qiwichupa

    Participant

    No. But if I enable tree comments, the topic starts to appear on one page and the links seem to be correct. However, even without tree comments I have not found errors on the first pages of topics, it starts to appear at least from the second page, and sometimes later – for example, from the sixth page.

    @robin-w

    Moderator

    ok, I am not a bbpress author, just someone who tries to help out.

    So it’s Sunday morning here in the UK, and I have guests coming for lunch, so I will try and pick this up later.

    But let’s just eliminate some stuff.

    1.

    dashboard>settings>permalinks and just click save – this resets the permalinks and may help

    2.

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back

    @qiwichupa

    Participant

    Thanks for trying to help! I followed your advice, but unfortunately none of the above helped. Despite a different theme and disabling plugins the page is generated similarly. Changing and saving permalink settings didn’t lead to any result either (from what I understand, bbpress uses hardcoded settings to generate links).

    Maybe there’s some way to recreate a topic from scratch by copying post by post from the old one into it? So that the bbpress engine is fully responsible for the process (still think the problem might be a result of incorrect import from Mingle). Doing it manually is too time consuming =\

    @robin-w

    Moderator

    maybe try changing the replies per page in

    dashboard>settings>forums

    and see what difference that makes

    @qiwichupa

    Participant

    it doesn’t change anything fundamentally, but the errors in the links show up on other posts in the thread.

    @robin-w

    Moderator

    ok, back to this…

    so yo say the permalink

    mydomain/bbforums/topic/stream-records/page/8#post-121032

    Where are you seeing this permalink?

    eg

    “I go to forums, select forum ‘xxx’ and then I do this and get to the topic by pressing that, and the I see the permalink at…”

    and in

    dashboard>settings>permalinks

    what is the permalink structure?

    @qiwichupa

    Participant

    Sorry, I’m using a translator, so something might be misspelled.

    The permalinks I’m talking about are at each post. That is, I open the forum, go to a topic and near each post there is a link to that post.

    On the first page, the links look like:
    “mydomain/bbforums/topic/stream-records#post-120313” (bbforums is the root of the forum, stream-records is an example thread)

    On subsequent pages, the links take the form:
    “mydomain/bbforums/topic/stream-records/page/8#post-121032”.

    And if on the first pages everything is ok, then on the next pages these links may have wrong page numbers. That is, clicking on them does not fix the position of the post, but opens another page that does not have this post on it.

    I’ll try with my next reply to attach the full link so you can see what I mean. I hope it doesn’t go to spam)

    @qiwichupa

    Participant

    Right here on this page

    https://garage.qiwichupa.net/bbforums/topic/stream-records/page/8

    the link in the top post (#120964) leads to the previous page, the links in the following posts are correct, but at the very bottom (starting from #121101) the links lead to the next page.

    @robin-w

    Moderator

    Thanks, it is evening here in the UK, I’ll try and look at this tomorrow

    @qiwichupa

    Participant

    Thank you!

    @robin-w

    Moderator

    ok, some late night thinking….

    bbpress just uses the WordPress function that finds and shows posts (bbpress forums, topics and replies are just posts with a custom post type!).

    So I’m thinking that the ‘find matches’ wordpress part is finding x number of replies, but then the ‘display part’ is finding one less/more to display, then at that point the page count gets to be wrong.

    This is just a guess at the moment, but as you are seeing issues with other topics that are not all ‘page 8’ I don’t think it is a pure maths issue.

    So my current hypothesis is that there is an item that is in the database as a match, but there is not a corresponding item to display – this could be for lots of reasons.

    If you go to your link but page 7, from the post numbered 120998 with text ‘AnTiHrIsTiS — Kingpin: Life of Crime (PC)’ this entry on page 7 has a link of

    /steam-records/page/8#120998

    If my thinking is correct (and it is probably wrong!) I’d guess it is at this point that the permalinks start to go wrong.

    So if you change the replies per page from 14 to 13, does it still start to go wrong from that same post number, or does it start to go wrong from another post number.

    This will help us narrow down what the issue might be.

    @qiwichupa

    Participant

    I changed the number of replies to 13. Post 120998 was 4th from the bottom before, now on page 7 the error starts with the 3rd post from the bottom. Post 120998 has moved to page 8 and no longer has the error, and the errors only start from the 3rd post from the bottom too. I don’t see any system in this, it seems that the errors are not tied to any particular post or range of posts.

    @robin-w

    Moderator

    do you still have the original Mingle forum?

    If so, can you check that all the entries around this one have transferred to bbpress ie they have the same number of replies and are in the same order on page 7/8

    @qiwichupa

    Participant

    Yes, Mingle is still working. I set 10 replies per page to accurately correlate posts to pages on both forums. The number of posts matches.

    I checked the order of the posts from page 1 to page 7 until I found the wrong link – it’s now on the same page 7, in the last post (#120847 – “Бормотунчик – Mitsume ga Tooru”). Up to that point, all posts are present and in the same order as in Mingle.

    https://garage.qiwichupa.net/bbforums/topic/stream-records/page/7
    https://garage.qiwichupa.net/forums?mingleforumaction=viewtopic&t=3.6

    @iltaja

    Blocked

    Likely a post order or metadata issue from the import. bbPress relies on accurate data to place posts on the right pages. Built-in repair tools often miss this. Your split/merge method suggests the problem is in the original post structure.

    @qiwichupa

    Participant

    Maybe it makes sense to look at the database? I don’t know much about which tables contain the necessary information, but I think it’s in _posts and _postmeta. But the structure of data in these tables is not clear enough for me to understand where it makes sense to look and how “correct” data differs from “incorrect” data.

    @robin-w

    Moderator

    iltaja is an AI spambot I suspect, this forum gets lots of these.

    If not I’m sure they will reply again.

    From your post about changing number of replies to 13, if the ‘faulty’ post is changing, then I suspect that looking at the database won’t help at this stage.

    Let me do some more thinking…

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