1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 22:58:10 +01:00

Merge pull request #5520 from 3D-I/ticket/15950

[ticket/15950] Add SQL transactions to mcp_main.php
This commit is contained in:
Marc Alexander 2019-03-16 13:24:00 +01:00
commit 761b87659d
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -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))