Skip to:
Content

Opened 5 years ago

Last modified 4 years ago

#2461 new defect

bbPress1.php importing spam topics & replies

Reported by: netweb Owned by: netweb
Milestone: 2.8 Priority: low
Severity: normal Version: 2.4.1
Component: API - Importers Keywords:
Cc:

Description

When importing with bbPress1.php (Either bbPress v1.2 or BuddyPress Group Forums) if a topic or reply is marked as spam then the importer will import all three as individual topics instead of one topic and two replies.

As we use 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0,1)', as the main expression to distinguish between topics and replies this is not ideal.

  • A typical topic with two replies (you only need to take note of the last value for post_position on each line)
INSERT INTO `bb_posts` (`post_id`, `forum_id`, `topic_id`, `poster_id`, `post_text`, `post_time`, `poster_ip`, `post_status`, `post_position`) VALUES
(2, 2, 2, 1, '<p>Closed Topic Content\n</p>\n', '2013-11-03 22:23:27', '10.1.1.8', 0, 1),
(3, 2, 2, 1, '<p>Closed Topic First Reply\n</p>\n', '2013-11-03 22:23:39', '10.1.1.8', 0, 2),
(4, 2, 2, 1, '<p>Closed Topic Second Reply\n</p>\n', '2013-11-03 22:23:48', '10.1.1.8', 0, 3),
  • A topic with two replies all marked as spam, the post_position value is changed to 1 for both topic and both replies.
INSERT INTO `bb_posts` (`post_id`, `forum_id`, `topic_id`, `poster_id`, `post_text`, `post_time`, `poster_ip`, `post_status`, `post_position`) VALUES
(11, 2, 5, 1, '<p>Spam Topic Content\n</p>\n', '2013-11-03 22:26:07', '10.1.1.8', 2, 1),
(12, 2, 5, 1, '<p>Spam Topic First Reply\n</p>\n', '2013-11-03 22:26:16', '10.1.1.8', 2, 1),
(13, 2, 5, 1, '<p>Spam Topic Second Reply\n</p>\n', '2013-11-03 22:26:24', '10.1.1.8', 2, 1),
  • Workaround: After importing delete ALL your spam from WordPress

Change History (3)

#1 @johnjamesjacoby
5 years ago

  • Milestone changed from Awaiting Review to 2.7

The only place I see post positions being updated is in bb_update_post_positions. Any idea how replies got that position in the first place?

#2 @netweb
5 years ago

Topic (bb_topics.topic_status) and topic content (bb_posts.post_status) have separate spam status.

If only the topic content is marked as spam (bb_posts.post_status) this does not mark the entire topic as spam (bb_topics.topic_status) and will cause the first reply to be promoted to post_position = 1.

The entire topic is not marked as spam (bb_topics.topic_status = 2) until both the topic content and all replies are marked as spam.

SELECT topic_id, topic_title, topic_status FROM bb_topics WHERE topic_id = 5;

topic_id topic_title topic_status
5 bbPress Legacy Forum Spam Topic 0

SELECT bb_posts.post_id, bb_posts.topic_id, bb_posts.post_text, bb_posts.post_status, bb_posts.post_position FROM bb_posts where bb_posts.topic_id = 5;

post_id topic_id post_text post_status post_position
11 5 <p>bbPress Legacy Forum Spam Topic Content21
12 5 <p>bbPress Legacy Forum Spam Topic First Reply01
13 5 <p>bbPress Legacy Forum Spam Topic Second Reply02

https://i.cloudup.com/7zCMu5HXQO.JPG

#3 @johnjamesjacoby
4 years ago

  • Milestone changed from 2.7 to 2.8

Bumping all 2.7 to 2.8 milestone.

Note: See TracTickets for help on using tickets.