Skip to content

Commit 7a55bcc

Browse files
committed
Merge pull request phpbb#3611 from Alf007/ticket/13841
Ticket/13841
2 parents 5183192 + 1f385b5 commit 7a55bcc

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

phpBB/includes/functions_admin.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
500500
*/
501501
function move_topics($topic_ids, $forum_id, $auto_sync = true)
502502
{
503-
global $db;
503+
global $db, $phpbb_dispatcher;
504504

505505
if (empty($topic_ids))
506506
{
@@ -534,6 +534,27 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true)
534534
}
535535

536536
$table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
537+
538+
/**
539+
* Perform additional actions before topics move
540+
*
541+
* @event core.move_topics_before_query
542+
* @var array table_ary Array of tables from which forum_id will be updated for all rows that hold the moved topics
543+
* @var array topic_ids Array of the moved topic ids
544+
* @var string forum_id The forum id from where the topics are moved
545+
* @var array forum_ids Array of the forums where the topics are moving (includes also forum_id)
546+
* @var bool auto_sync Whether or not to perform auto sync
547+
* @since 3.1.5-RC1
548+
*/
549+
$vars = array(
550+
'table_ary',
551+
'topic_ids',
552+
'forum_id',
553+
'forum_ids',
554+
'auto_sync',
555+
);
556+
extract($phpbb_dispatcher->trigger_event('core.move_topics_before_query', compact($vars)));
557+
537558
foreach ($table_ary as $table)
538559
{
539560
$sql = "UPDATE $table

0 commit comments

Comments
 (0)