From 699c6421288844b3b41bad12ada9d8f8e71d45fc Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Fri, 10 Oct 2014 14:24:46 +0200 Subject: [PATCH 1/3] [ticket/13164] Update post_visibility before event is triggered PHPBB3-13164 --- phpBB/includes/functions_posting.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 1fdc7ee9ea..db36539b49 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2369,6 +2369,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx"; $url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor; + // update post_visibility in $data + $data['post_visibility'] = $post_visibility; /** * This event is used for performing actions directly after a post or topic * has been submitted. When a new topic is posted, the topic ID is From eb7152436c160d835ca15835c45e256465cfc232 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sat, 11 Oct 2014 16:56:03 +0200 Subject: [PATCH 2/3] [ticket/13164] Add post_visibility to core.submit_post_end event PHPBB3-13164 --- phpBB/includes/functions_posting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index db36539b49..57dc3a79c6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2369,8 +2369,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx"; $url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor; - // update post_visibility in $data - $data['post_visibility'] = $post_visibility; /** * This event is used for performing actions directly after a post or topic * has been submitted. When a new topic is posted, the topic ID is @@ -2386,6 +2384,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u * @var int topic_type Variable containing topic type value * @var array poll Array with the poll data for the post * @var array data Array with the data for the post + * @var int post_visibility Variable containing up to date post visibility * @var bool update_message Flag indicating if the post will be updated * @var bool update_search_index Flag indicating if the search index will be updated * @var string url The "Return to topic" URL @@ -2401,6 +2400,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_type', 'poll', 'data', + 'post_visibility,' 'update_message', 'update_search_index', 'url', From 9bc9e42c94d51cb5fbefefd97dd706c33f269614 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sat, 11 Oct 2014 17:58:41 +0200 Subject: [PATCH 3/3] [ticket/13164] Fix syntax error PHPBB3-13164 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 57dc3a79c6..af44f6270e 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2400,7 +2400,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_type', 'poll', 'data', - 'post_visibility,' + 'post_visibility', 'update_message', 'update_search_index', 'url',