View Issue Details

IDProjectCategoryView StatusLast Update
0009309mantisbtemailpublic2008-10-18 18:32
ReporterOlegD 
Assigned Togiallu 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSLinuxOS Version2.6.23
Product Version1.1.2 
Target Version1.1.3Fixed in Version1.1.3 
Summary0009309: Problems with e-mail notifications about bugnotes [PATCH]
Description

Mantis 2.6.23 never sends e-mail notifications about new bugnotes. This happens because of improper checking of uninitialized variable $p_send_email in bugnote_add(). Attached patch fixes this.

Steps To Reproduce
  1. Create new bug report;
  2. Assign it to some user/create bug monitor regarding this bug for some user;
  3. Add note for a bug;
  4. No e-mail will be sent to user.
Tagspatch

Relationships

has duplicate 0009305 closedgiallu Update from 1.1.1 to 1.1.2 caused email notifications to stop 
has duplicate 0009327 closedgiallu After enable email notify, all user can't recieve the notify email of "note add". 
has duplicate 0009457 closedgiallu cant get Mantis to send note added notification emails 

Activities

2008-06-27 19:00

 

bugnote_api.php.patch (794 bytes)
*** bugnote_api.php.orig	Sat May 31 00:53:29 2008
--- bugnote_api.php	Sat Jun 28 01:11:45 2008
***************
*** 164,170 ****
  		history_log_event_special( $p_bug_id, BUGNOTE_ADDED, bugnote_format_id( $t_bugnote_id ) );
  
  		# only send email if the text is not blank, otherwise, it is just recording of time without a comment.
! 		if ( $p_send_email && !is_blank( $p_bugnote_text ) ) {
  			email_bugnote_add( $p_bug_id );
  		}
  		return $t_bugnote_id;
--- 164,170 ----
  		history_log_event_special( $p_bug_id, BUGNOTE_ADDED, bugnote_format_id( $t_bugnote_id ) );
  
  		# only send email if the text is not blank, otherwise, it is just recording of time without a comment.
! 		if ( !is_blank( $p_bugnote_text ) ) {
  			email_bugnote_add( $p_bug_id );
  		}
  		return $t_bugnote_id;
bugnote_api.php.patch (794 bytes)
grangeway

grangeway

2008-06-28 08:52

reporter   ~0018217

Oleg,

The function definition sets p_send_email:

function bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = 0, $p_attr = '', $p_user_id = null, $p_send_email=TRUE ) {

I know in my various versions I get email notifications on adding bugnotes, so I suspect something else might be at fault or there's a bug elsewhere, but as you can see p_send_email is defined.

Paul

OlegD

OlegD

2008-06-28 09:57

reporter   ~0018219

There is no p_send_email parameter in function definition in Mantis 1.1.2:

function bugnote_add ( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = 0, $p_attr = '', $p_user_id = null ) {
[...]
}

I don't know where you get your definition. My definition is from core/bugnote_api.php from mantis-1.1.2.tar.gz (latest stable version available from your site).

blueray

blueray

2008-06-28 12:19

reporter   ~0018220

Hi,

I'am confuse too.
I found that the $p_send_email=TRUE was in the trunk but no other.

The $p_send_email=TRUE
and the code block

    # only send email if the text is not blank, otherwise, it is just recording of time without a comment.

! if ( !is_blank( $p_bugnote_text ) ) {
email_bugnote_add( $p_bug_id );

was remove.

This is a new change in 1.2.x branches ?

vboctor

vboctor

2008-07-01 01:27

manager   ~0018253

Fixed via svn:5385
http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5385&view=rev

$p_send_email wasn't initialized in 1.1.x branch.

giallu

giallu

2008-07-02 03:16

reporter   ~0018270

/me wonder how this slipped in...

OlegD

OlegD

2008-07-02 05:06

reporter   ~0018277

After further research, I found that in some places where bugnote_add() called (even in 1.1.x branch) the presence of last parameter p_send_email is assumed (for example, such call exists in bug_reminder.php). So, the correct patch should just add this parameter to function definition (with default value TRUE). I will attach this patch later.

2008-07-02 05:10

 

correct_bugnote_api.php.patch (971 bytes)
*** bugnote_api.php.orig	Sat May 31 00:53:29 2008
--- bugnote_api.php	Sat Jun 28 20:32:03 2008
***************
*** 99,105 ****
  	# Add a bugnote to a bug
  	#
  	# return the ID of the new bugnote
! 	function bugnote_add ( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = 0, $p_attr = '', $p_user_id = null ) {
  		$c_bug_id            	= db_prepare_int( $p_bug_id );
  		$c_bugnote_text      	= db_prepare_string( $p_bugnote_text );
  		$c_time_tracking	= db_prepare_time( $p_time_tracking );
--- 99,105 ----
  	# Add a bugnote to a bug
  	#
  	# return the ID of the new bugnote
! 	function bugnote_add ( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_private = false, $p_type = 0, $p_attr = '', $p_user_id = null, $p_send_email=TRUE ) {
  		$c_bug_id            	= db_prepare_int( $p_bug_id );
  		$c_bugnote_text      	= db_prepare_string( $p_bugnote_text );
  		$c_time_tracking	= db_prepare_time( $p_time_tracking );
OlegD

OlegD

2008-07-02 05:11

reporter   ~0018278

Attached file correct_bugnote_api.php.patch should fix this issue in more reasonable way. This patch is against original version from .tar.gz, not against current SVN snapshot.

jaiger

jaiger

2008-07-10 16:54

reporter   ~0018361

The change made in correct_bugnote_api.php.patch seems to resolve the problems for me. I'm using 1.1.2 tarball.

Thanks!

-Joe

giallu

giallu

2008-07-12 18:30

reporter   ~0018381

ok, I ported the relevant code from trunk.

It would be nice if someone could test the BRANCH_1_1_X code to double check the fix.

giallu

giallu

2008-07-12 18:38

reporter   ~0018382

Diff here:
http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5407&view=rev

giallu

giallu

2008-07-14 09:41

reporter   ~0018511

This is the same diff, but against 1.1.2:

http://mantisbt.svn.sourceforge.net/viewvc/mantisbt/branches/BRANCH_1_1_0/mantisbt/core/bugnote_api.php?r1=5370&r2=5407

Extend

Extend

2008-09-22 18:13

reporter   ~0019425

how can i apply this patch i just upgraded from an earlier version i found different settings for the email notification i want someone to provide me how to configure notification to be sent when assigned a bug to someone or add a note to developer who maintaining this bug only, i tried to customize email notifications from the mantis web interface but there are a lot of conflicts.

Related Changesets

MantisBT: master-1.1.x b76e4818

2008-07-12 22:23:36

giallu

Details Diff
Fix 9309: Problems with e-mail notifications about bugnotes.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/branches/BRANCH_1_1_0@5407 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
mod - core/bugnote_api.php Diff File

Issue History

Date Modified Username Field Change
2008-06-27 19:00 OlegD New Issue
2008-06-27 19:00 OlegD File Added: bugnote_api.php.patch
2008-06-28 08:52 grangeway Note Added: 0018217
2008-06-28 08:52 grangeway Status @0@ => resolved
2008-06-28 08:52 grangeway Resolution @0@ => suspended
2008-06-28 08:52 grangeway Assigned To => grangeway
2008-06-28 09:57 OlegD Note Added: 0018219
2008-06-28 09:57 OlegD Status @0@ => feedback
2008-06-28 09:57 OlegD Resolution @0@ => reopened
2008-06-28 12:19 blueray Note Added: 0018220
2008-06-30 13:52 vboctor Tag Attached: patch
2008-06-30 13:53 vboctor Relationship added related to 0009305
2008-07-01 01:27 vboctor Note Added: 0018253
2008-07-01 01:27 vboctor Assigned To grangeway => vboctor
2008-07-01 01:27 vboctor Status feedback => resolved
2008-07-01 01:27 vboctor Resolution reopened => fixed
2008-07-01 01:27 vboctor Fixed in Version => 1.1.3
2008-07-02 03:16 giallu Note Added: 0018270
2008-07-02 03:17 giallu Relationship added has duplicate 0009327
2008-07-02 05:06 OlegD Note Added: 0018277
2008-07-02 05:06 OlegD Status @0@ => feedback
2008-07-02 05:06 OlegD Resolution @0@ => reopened
2008-07-02 05:10 OlegD File Added: correct_bugnote_api.php.patch
2008-07-02 05:11 OlegD Note Added: 0018278
2008-07-10 16:54 jaiger Note Added: 0018361
2008-07-11 13:01 giallu Status feedback => assigned
2008-07-11 13:01 giallu Assigned To vboctor => giallu
2008-07-11 18:38 giallu Relationship replaced has duplicate 0009305
2008-07-12 18:30 giallu Note Added: 0018381
2008-07-12 18:30 giallu Status @0@ => resolved
2008-07-12 18:30 giallu Resolution @0@ => fixed
2008-07-12 18:38 giallu Note Added: 0018382
2008-07-14 09:41 giallu Note Added: 0018511
2008-07-30 16:07 giallu Relationship added has duplicate 0009457
2008-08-01 11:52 giallu Target Version => 1.1.3
2008-09-22 18:13 Extend Note Added: 0019425
2008-10-18 18:32 giallu Status resolved => closed
2008-10-20 20:19 Changeset attached master-1.1.x e561d1cb =>
2008-11-11 09:03 giallu Changeset attached master-1.1.x b76e4818 =>