Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2019-03-16 13:24:06 +01:00
commit 3bdd554b71
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)) if (confirm_box(true))
{ {
$db->sql_transaction('begin');
$sql = 'UPDATE ' . TOPICS_TABLE . " $sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids); 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 . ' $sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
$db->sql_query($sql); $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'; $success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';
if (count($topic_ids)) if (count($topic_ids))