diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2012-10-06 19:56:52 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2012-10-06 19:56:52 +0200 |
| commit | 25804eb8e8b17196116e233b2c8ad3b444cfb5ae (patch) | |
| tree | b2a6a333f645f8c537870eb2cafba779ea298633 /phpBB/includes | |
| parent | 44005f338e227c10a21270456d181d56749d3f29 (diff) | |
| download | forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar.gz forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar.bz2 forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar.xz forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.zip | |
[feature/soft-delete] Add test case for (soft)deleting the only post + fix
PHPBB3-9567
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/content_visibility.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/functions_posting.php | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/phpBB/includes/content_visibility.php b/phpBB/includes/content_visibility.php index 54c580cd40..0d08cb83b6 100644 --- a/phpBB/includes/content_visibility.php +++ b/phpBB/includes/content_visibility.php @@ -416,7 +416,7 @@ class phpbb_content_visibility $forum_id_list[$post_data['forum_id']] = 1; } - // User post update (we do not care about topic or post, since user posts are strictly connected to posts) + // User post update (we do not care about topic or post, since user topics are strictly connected to posts) // But we care about forums where post counts get not increased. ;) if ($post_data['post_postcount']) { diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index d9fbd84ce1..9cf7b59ad3 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1461,11 +1461,11 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ } // (Soft) delete the post - if ($is_soft) + if ($is_soft && ($post_mode != 'delete_topic')) { phpbb_content_visibility::set_post_visibility(ITEM_DELETED, $post_id, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason, ($data['topic_first_post_id'] == $post_id), ($data['topic_last_post_id'] == $post_id)); } - else + else if (!$is_soft) { if (!delete_posts('post_id', array($post_id), false, false)) { @@ -1502,7 +1502,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ { $topic_row = array(); phpbb_content_visibility::set_topic_visibility(ITEM_DELETED, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason); - phpbb_content_visibility::remove_topic_from_statistic($topic_id, $forum_id, $topic_row, $sql_data); } else { |
