From 9d2ab88c69492e535bfd984a81f92be30c85e157 Mon Sep 17 00:00:00 2001 From: Alec Date: Sat, 12 Jan 2019 06:48:57 -0500 Subject: [PATCH] [ticket/15925] Add core.mcp_main_modify_fork_post_sql Modify the forked post's sql array before it's inserted into the database Lets additional variables be added into the sql_ary Allows the same edits as mcp_main_fork_sql_after but for posts not topics PHPBB3-15925 --- phpBB/includes/mcp/mcp_main.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 9cf4ca9c96..a3fa0b20d9 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1563,6 +1563,26 @@ function mcp_fork_topic($topic_ids) $counter[$row['poster_id']] = 1; } } + + /** + * Modify the forked post's sql array before it's inserted into the database. + * + * @event core.mcp_main_modify_fork_post_sql + * @var int new_topic_id The newly created topic ID + * @var int to_forum_id The forum ID where the forked topic has been moved to + * @var array sql_ary SQL Array with the post's data + * @var array row Post data + * @var array counter Array with post counts + * @since 3.2.6-RC1 + */ + $vars = array( + 'new_topic_id', + 'to_forum_id', + 'sql_ary', + 'row', + 'counter', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_post_sql', compact($vars))); $db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $new_post_id = $db->sql_nextid();