1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/soft-delete] Fix a bug in sync() and set_post_visibility()

PHPBB3-9657
This commit is contained in:
Joas Schilling
2012-10-02 15:34:18 +02:00
parent 1f8f07b998
commit 5b64ebc11d
2 changed files with 11 additions and 10 deletions

View File

@@ -1908,12 +1908,12 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
unset($delete_topics[$topic_id]);
$topic_data[$topic_id]['replies_real'] += $row['total_posts'];
$topic_data[$topic_id]['first_post_id'] = (!$topic_data[$topic_id]['first_post_id']) ? $row['first_post_id'] : min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']);
if ($row['post_visibility'] || !$topic_data[$topic_id]['last_post_id'])
if ($row['post_visibility'] == ITEM_APPROVED)
{
$topic_data[$topic_id]['replies'] = $row['total_posts'] - 1;
$topic_data[$topic_id]['first_post_id'] = $row['first_post_id'];
$topic_data[$topic_id]['last_post_id'] = $row['last_post_id'];
$topic_data[$topic_id]['replies'] = $row['total_posts'] - 1;
}
}
}