aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-03-16 13:24:00 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-03-16 13:24:00 +0100
commit761b87659d970da2dcfdba0a4f5e86d4053871ee (patch)
tree14a3986cad83f8ced94fdb0a049f2ff204d03e4c
parent2bbf72e15806ac55a06e7ff36002f68c739930c3 (diff)
parentca4a98a2de7c20768e794eb62a519c920950823a (diff)
downloadforums-761b87659d970da2dcfdba0a4f5e86d4053871ee.tar
forums-761b87659d970da2dcfdba0a4f5e86d4053871ee.tar.gz
forums-761b87659d970da2dcfdba0a4f5e86d4053871ee.tar.bz2
forums-761b87659d970da2dcfdba0a4f5e86d4053871ee.tar.xz
forums-761b87659d970da2dcfdba0a4f5e86d4053871ee.zip
Merge pull request #5520 from 3D-I/ticket/15950
[ticket/15950] Add SQL transactions to mcp_main.php
-rw-r--r--phpBB/includes/mcp/mcp_main.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 733bcccc09..d20878a279 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -426,6 +426,8 @@ function change_topic_type($action, $topic_ids)
if (confirm_box(true))
{
+ $db->sql_transaction('begin');
+
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids);
@@ -437,13 +439,10 @@ function change_topic_type($action, $topic_ids)
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
$db->sql_query($sql);
-
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_type = $new_topic_type
- WHERE " . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
}
+ $db->sql_transaction('commit');
+
$success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';
if (count($topic_ids))