From ce2d3a3fb507b18d84b0c7d79827839fa39db749 Mon Sep 17 00:00:00 2001
From: Roland Becker <roland@atrol.de>
Date: Thu, 19 Aug 2010 17:21:04 +0200
Subject: [PATCH] Fix #12217: Email is not sent when assigning new issue

---
 core/bug_api.php |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/bug_api.php b/core/bug_api.php
index 7d6e030..50817af 100644
--- a/core/bug_api.php
+++ b/core/bug_api.php
@@ -529,6 +529,12 @@ class BugData {
 
 		# allow bypass if user is sending mail separately
 		if( false == $p_bypass_mail ) {
+			# bug assigned
+			if( $t_old_data->handler_id != $this->handler_id ) {
+				email_generic( $c_bug_id, 'owner', 'email_notification_title_for_action_bug_assigned' );
+				return true;
+			}
+
 			# status changed
 			if( $t_old_data->status != $this->status ) {
 				$t_status = MantisEnum::getLabel( config_get( 'status_enum_string' ), $this->status );
@@ -537,12 +543,6 @@ class BugData {
 				return true;
 			}
 
-			# bug assigned
-			if( $t_old_data->handler_id != $this->handler_id ) {
-				email_generic( $c_bug_id, 'owner', 'email_notification_title_for_action_bug_assigned' );
-				return true;
-			}
-
 			# @todo handle priority change if it requires special handling
 			# generic update notification
 			email_generic( $c_bug_id, 'updated', 'email_notification_title_for_action_bug_updated' );
-- 
1.7.2.1

