aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-25 16:06:11 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-25 16:06:11 +0000
commit4ca00cba39a0169bd521cbe7e9bd24d3bf3c1cd2 (patch)
treed37cd35ffe2f474f21c27e49755815938dda4770 /phpBB/includes/functions_posting.php
parentc28dc56084ec8b3e391d528ec05264a192001b19 (diff)
downloadforums-4ca00cba39a0169bd521cbe7e9bd24d3bf3c1cd2.tar
forums-4ca00cba39a0169bd521cbe7e9bd24d3bf3c1cd2.tar.gz
forums-4ca00cba39a0169bd521cbe7e9bd24d3bf3c1cd2.tar.bz2
forums-4ca00cba39a0169bd521cbe7e9bd24d3bf3c1cd2.tar.xz
forums-4ca00cba39a0169bd521cbe7e9bd24d3bf3c1cd2.zip
please have a second look at the change within session.php - we had a few "doubled" keys within the db...
git-svn-id: file:///svn/phpbb/trunk@7946 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index bc968c5e1b..4b38919e81 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -2276,6 +2276,19 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$db->sql_query($sql);
}
+ // Committing the transaction before updating search index
+ $db->sql_transaction('commit');
+
+ // Delete draft if post was loaded...
+ $draft_id = request_var('draft_loaded', 0);
+ if ($draft_id)
+ {
+ $sql = 'DELETE FROM ' . DRAFTS_TABLE . "
+ WHERE draft_id = $draft_id
+ AND user_id = {$user->data['user_id']}";
+ $db->sql_query($sql);
+ }
+
// Index message contents
if ($update_message && $data['enable_indexing'])
{
@@ -2303,16 +2316,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
}
- // Delete draft if post was loaded...
- $draft_id = request_var('draft_loaded', 0);
- if ($draft_id)
- {
- $sql = 'DELETE FROM ' . DRAFTS_TABLE . "
- WHERE draft_id = $draft_id
- AND user_id = {$user->data['user_id']}";
- $db->sql_query($sql);
- }
-
// Topic Notification, do not change if moderator is changing other users posts...
if ($user->data['user_id'] == $poster_id)
{
@@ -2331,8 +2334,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
}
- $db->sql_transaction('commit');
-
if ($mode == 'post' || $mode == 'reply' || $mode == 'quote')
{
// Mark this topic as posted to