[ticket/15925] Update events for 3.3.3-RC1

PHPBB3-15925
This commit is contained in:
Marc Alexander 2020-11-28 22:18:49 +01:00
parent 86bbd05608
commit 60d6727974
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
3 changed files with 23 additions and 21 deletions

View file

@ -1841,9 +1841,9 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
* *
* @event core.sync_forum_last_post_info_sql * @event core.sync_forum_last_post_info_sql
* @var array sql_ary SQL array with some post and user data from the last posts list * @var array sql_ary SQL array with some post and user data from the last posts list
* @since 3.2.6-RC1 * @since 3.3.3-RC1
*/ */
$vars = array('sql_ary'); $vars = ['sql_ary'];
extract($phpbb_dispatcher->trigger_event('core.sync_forum_last_post_info_sql', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.sync_forum_last_post_info_sql', compact($vars)));
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
@ -1894,13 +1894,13 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
* @var array forum_data Array with data to update for all forum ids * @var array forum_data Array with data to update for all forum ids
* @var array post_info Array with some post and user data from the last posts list * @var array post_info Array with some post and user data from the last posts list
* @var array fieldnames Array with the partial column names that are being updated * @var array fieldnames Array with the partial column names that are being updated
* @since 3.2.6-RC1 * @since 3.3.3-RC1
*/ */
$vars = array( $vars = [
'forum_data', 'forum_data',
'post_info', 'post_info',
'fieldnames', 'fieldnames',
); ];
extract($phpbb_dispatcher->trigger_event('core.sync_modify_forum_data', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.sync_modify_forum_data', compact($vars)));
unset($post_info); unset($post_info);
@ -2082,19 +2082,19 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
AND u.user_id = p.poster_id', AND u.user_id = p.poster_id',
); );
$custom_fieldnames = array(); $custom_fieldnames = [];
/** /**
* Event to modify the SQL array to get the post and user data from all topics' last posts * Event to modify the SQL array to get the post and user data from all topics' last posts
* *
* @event core.sync_topic_last_post_info_sql * @event core.sync_topic_last_post_info_sql
* @var array sql_ary SQL array with some post and user data from the last posts list * @var array sql_ary SQL array with some post and user data from the last posts list
* @var array custom_fieldnames Empty array for custom fieldnames to update the topics_table with * @var array custom_fieldnames Empty array for custom fieldnames to update the topics_table with
* @since 3.2.6-RC1 * @since 3.3.1-RC1
*/ */
$vars = array( $vars = [
'sql_ary', 'sql_ary',
'custom_fieldnames', 'custom_fieldnames',
); ];
extract($phpbb_dispatcher->trigger_event('core.sync_topic_last_post_info_sql', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.sync_topic_last_post_info_sql', compact($vars)));
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
@ -2126,13 +2126,13 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
* @var array topic_data Array with the topics' data we are syncing * @var array topic_data Array with the topics' data we are syncing
* @var array row Array with some of the current user and post data * @var array row Array with some of the current user and post data
* @var int topic_id The current topic_id of $row * @var int topic_id The current topic_id of $row
* @since 3.2.6-RC1 * @since 3.3.1-RC1
*/ */
$vars = array( $vars = [
'topic_data', 'topic_data',
'row', 'row',
'topic_id', 'topic_id',
); ];
extract($phpbb_dispatcher->trigger_event('core.sync_modify_topic_data', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.sync_modify_topic_data', compact($vars)));
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -2251,6 +2251,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// Add custom fieldnames // Add custom fieldnames
$fieldnames = array_merge($fieldnames, $custom_fieldnames); $fieldnames = array_merge($fieldnames, $custom_fieldnames);
unset($custom_fieldnames);
if ($sync_extra) if ($sync_extra)
{ {

View file

@ -356,12 +356,12 @@ function update_post_information($type, $ids, $return_update_sql = false)
* @event core.update_post_info_modify_posts_sql * @event core.update_post_info_modify_posts_sql
* @var string type The table being updated (forum or topic) * @var string type The table being updated (forum or topic)
* @var array sql_ary SQL array to get some of the last posts' data * @var array sql_ary SQL array to get some of the last posts' data
* @since 3.2.6-RC1 * @since 3.3.3-RC1
*/ */
$vars = array( $vars = [
'type', 'type',
'sql_ary', 'sql_ary',
); ];
extract($phpbb_dispatcher->trigger_event('core.update_post_info_modify_posts_sql', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.update_post_info_modify_posts_sql', compact($vars)));
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
@ -385,14 +385,15 @@ function update_post_information($type, $ids, $return_update_sql = false)
* @var string type The table being updated (forum or topic) * @var string type The table being updated (forum or topic)
* @var array rowset Array with the posts data * @var array rowset Array with the posts data
* @var array update_sql Array with SQL data to update the forums or topics table with * @var array update_sql Array with SQL data to update the forums or topics table with
* @since 3.2.6-RC1 * @since 3.3.3-RC1
*/ */
$vars = array( $vars = [
'type', 'type',
'rowset', 'rowset',
'update_sql', 'update_sql',
); ];
extract($phpbb_dispatcher->trigger_event('core.update_post_info_modify_sql', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.update_post_info_modify_sql', compact($vars)));
unset($rowset);
} }
unset($empty_forums, $ids, $last_post_ids); unset($empty_forums, $ids, $last_post_ids);

View file

@ -1573,15 +1573,15 @@ function mcp_fork_topic($topic_ids)
* @var array sql_ary SQL Array with the post's data * @var array sql_ary SQL Array with the post's data
* @var array row Post data * @var array row Post data
* @var array counter Array with post counts * @var array counter Array with post counts
* @since 3.2.6-RC1 * @since 3.3.3-RC1
*/ */
$vars = array( $vars = [
'new_topic_id', 'new_topic_id',
'to_forum_id', 'to_forum_id',
'sql_ary', 'sql_ary',
'row', 'row',
'counter', 'counter',
); ];
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_post_sql', compact($vars))); 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)); $db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_post_id = $db->sql_nextid(); $new_post_id = $db->sql_nextid();