Al_ambique (@auberlu)

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • In reply to: Importer major issue

    @auberlu

    Participant

    I forgot to mention the other SQL script required to fix the import.
    Only the first post of each topic was displayed. A quick glance at the database and I saw that post_parent of each reply was set on the forum and not the topic.
    So here we go :

    UPDATE wp_posts m1 
    LEFT JOIN wp_postmeta m2 ON m1.ID = m2.post_id AND meta_key = '_bbp_topic_id'
    LEFT JOIN wp_posts m3 ON m1.post_parent = m3.ID AND m3.post_type != 'forum'
    SET m1.post_parent = m2.meta_key
    WHERE m1.post_type = 'reply' AND m1.post_parent != m2.meta_value
    In reply to: Importer major issue

    @auberlu

    Participant

    I forgot to mention the other SQL script required to fix the import.
    Only the first post of each topic was displayed. A quick glance at the database and I saw that post_parent of each reply was set on the forum and not the topic.
    So here we go :

    UPDATE wp_posts m1 
    LEFT JOIN wp_postmeta m2 ON m1.ID = m2.post_id AND meta_key = '_bbp_topic_id'
    LEFT JOIN wp_posts m3 ON m1.post_parent = m3.ID AND m3.post_type != 'forum'
    SET m1.post_parent = m2.meta_key
    WHERE m1.post_type = 'reply' AND m1.post_parent != m2.meta_value
Viewing 2 replies - 1 through 2 (of 2 total)