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.
Options

duplicate posts

Hi, I've done the export/import from punbb to latest standalone vanilla - and it mostly looks good.

However, after importing my (eg)5000 posts, it repeats the 5000 posts again - but this time, without the thread, just the original post. Very strange!! Any idea what might cause that and how to fix?

Comments

  • Options

    ok, im an idiot.... they are not duplicate posts.. the issue is with sorting.

    What happens is, after import - all posts with comments are shown first. Then posts with no comments are shown after. So, a new post from Feb 2013, is shown on page 30, after 1000s of older posts.

    That doesn't seem to make any sense. Any way to get things sorted by date, as one would expect? thanks.

  • Options

    OK - checking phpmyadmin, the field 'lastdatecomment' (in discussions) is NULL, where there isn't a comment. Thus, in the import, this has pushed those posts to the back (which is wrong).

    im guessing something is wrong when importing.

    To fix this, i guess i could make the lastdatecomment = dateinserted?

    Does anyone know of the SQL code to make that change where:

    if lastdatecomment = NULL, copypaste the dateinserted into that field

    thanks!

  • Options

    something like:

    UPDATE GDN_Discussion set DateLastComment = COALESCE(
    (select DateInserted from GDN_Discussion where DateLastComment IS NULL
    ),
    DateInserted)

    but that doesn't work. Anone know how to code that correctly?

    Thanks,

  • Options

    I'm having a conversation with myself here, but this seems to have solved the issue:

    UPDATE GDN_Discussion
    SET DateLastComment = DateInserted
    WHERE DateLastComment IS NULL;

    :)

  • Options
    hgtonighthgtonight ∞ · New MVP
    edited June 2013

    Thanks for sharing your conversation with the rest of us :D

    Welcome to the community!

    Have some Awesomes.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    maybe it helps someone :)

    and thanks!

Sign In or Register to comment.