mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 12:58:52 +00:00
[ticket/10109] Fix "Undefined Index" errors when copying a topic.
PHPBB3-10109
This commit is contained in:
parent
df622a1fab
commit
a72fe8acaf
1 changed files with 31 additions and 30 deletions
|
@ -1048,7 +1048,10 @@ function mcp_fork_topic($topic_ids)
|
|||
$total_posts = 0;
|
||||
$new_topic_id_list = array();
|
||||
|
||||
if ($topic_data['enable_indexing'])
|
||||
|
||||
foreach ($topic_data as $topic_id => $topic_row)
|
||||
{
|
||||
if (!isset($search_type) && $topic_row['enable_indexing'])
|
||||
{
|
||||
// Select the search method and do some additional checks to ensure it can actually be utilised
|
||||
$search_type = basename($config['search_type']);
|
||||
|
@ -1072,13 +1075,11 @@ function mcp_fork_topic($topic_ids)
|
|||
trigger_error($error);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!isset($search_type) && !$topic_row['enable_indexing'])
|
||||
{
|
||||
$search_type = false;
|
||||
}
|
||||
|
||||
foreach ($topic_data as $topic_id => $topic_row)
|
||||
{
|
||||
$sql_ary = array(
|
||||
'forum_id' => (int) $to_forum_id,
|
||||
'icon_id' => (int) $topic_row['icon_id'],
|
||||
|
@ -1187,9 +1188,9 @@ function mcp_fork_topic($topic_ids)
|
|||
// Copy whether the topic is dotted
|
||||
markread('post', $to_forum_id, $new_topic_id, 0, $row['poster_id']);
|
||||
|
||||
if ($search_type)
|
||||
if (!empty($search_type))
|
||||
{
|
||||
$search->index($search_mode, $sql_ary['post_id'], $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id);
|
||||
$search->index($search_mode, $new_post_id, $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id);
|
||||
$search_mode = 'reply'; // After one we index replies
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue