Browse Source

! Mantis bug 4894 - don't close the moderation reports for a post that's being deleted until we've gotten through all the tests that might otherwise mean we don't.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
37058a42fa
1 changed files with 17 additions and 17 deletions
  1. 17 17
      Sources/RemoveTopic.php

+ 17 - 17
Sources/RemoveTopic.php

@@ -658,23 +658,6 @@ function removeMessage($message, $decreasePostCount = true)
 			isAllowedTo('approve_posts');
 	}
 
-	// Close any moderation reports for this message.
-	$smcFunc['db_query']('', '
-		UPDATE {db_prefix}log_reported
-		SET closed = {int:is_closed}
-		WHERE id_msg = {int:id_msg}',
-		array(
-			'is_closed' => 1,
-			'id_msg' => $message,
-		)
-	);
-	if ($smcFunc['db_affected_rows']() != 0)
-	{
-		require_once($sourcedir . '/ModerationCenter.php');
-		updateSettings(array('last_mod_report_action' => time()));
-		recountOpenReports();
-	}
-
 	// Delete the *whole* topic, but only if the topic consists of one message.
 	if ($row['id_first_msg'] == $message)
 	{
@@ -993,6 +976,23 @@ function removeMessage($message, $decreasePostCount = true)
 	else
 		updateLastMessages($row['id_board']);
 
+	// Close any moderation reports for this message.
+	$smcFunc['db_query']('', '
+		UPDATE {db_prefix}log_reported
+		SET closed = {int:is_closed}
+		WHERE id_msg = {int:id_msg}',
+		array(
+			'is_closed' => 1,
+			'id_msg' => $message,
+		)
+	);
+	if ($smcFunc['db_affected_rows']() != 0)
+	{
+		require_once($sourcedir . '/ModerationCenter.php');
+		updateSettings(array('last_mod_report_action' => time()));
+		recountOpenReports();
+	}
+
 	return false;
 }