aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/content_visibility.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-02 15:34:18 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-02 15:34:18 +0200
commit5b64ebc11d10b66212661282a4dcfd411d038211 (patch)
tree151e53ef087f888fcbf953624077b69e9654c013 /phpBB/includes/content_visibility.php
parent1f8f07b9988b6c4aa83b517cfba6ff73a30e3ea3 (diff)
downloadforums-5b64ebc11d10b66212661282a4dcfd411d038211.tar
forums-5b64ebc11d10b66212661282a4dcfd411d038211.tar.gz
forums-5b64ebc11d10b66212661282a4dcfd411d038211.tar.bz2
forums-5b64ebc11d10b66212661282a4dcfd411d038211.tar.xz
forums-5b64ebc11d10b66212661282a4dcfd411d038211.zip
[feature/soft-delete] Fix a bug in sync() and set_post_visibility()
PHPBB3-9657
Diffstat (limited to 'phpBB/includes/content_visibility.php')
-rw-r--r--phpBB/includes/content_visibility.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/includes/content_visibility.php b/phpBB/includes/content_visibility.php
index 1aa2ad1a29..8bc67a7fd2 100644
--- a/phpBB/includes/content_visibility.php
+++ b/phpBB/includes/content_visibility.php
@@ -242,12 +242,6 @@ class phpbb_content_visibility
{
global $db;
- // if we're changing the starter, we need to change the rest of the topic
- if ($is_starter && !$is_latest)
- {
- return self::set_topic_visibility($visibility, $topic_id, $forum_id);
- }
-
if ($post_id)
{
$where_sql = 'post_id = ' . (int) $post_id;
@@ -274,8 +268,9 @@ class phpbb_content_visibility
$db->sql_query($sql);
// Sync the first/last topic information if needed
- if ($is_starter || $is_latest)
+ if (!$is_starter && $is_latest)
{
+ // update_post_information can only update the last post info ...
if ($topic_id)
{
update_post_information('topic', $topic_id, false);
@@ -285,6 +280,12 @@ class phpbb_content_visibility
update_post_information('forum', $forum_id, false);
}
}
+ else if (($is_starter || $is_latest) && $topic_id)
+ {
+ // ... so we need to use sync, if the first post is changed.
+ // The forum is resynced recursive by sync() itself.
+ sync('topic', 'topic_id', $topic_id, true);
+ }
}
/**