View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0009309 | mantisbt | public | 2008-06-27 19:00 | 2023-06-06 11:48 | |
| Reporter | OlegD | Assigned To | giallu | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | i386 | OS | Linux | OS Version | 2.6.23 |
| Product Version | 1.1.2 | ||||
| Target Version | 1.1.3 | Fixed in Version | 1.1.3 | ||
| Summary | 0009309: 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 |
| ||||
| Tags | patch | ||||
| Attached Files | 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;
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 );
| ||||
| has duplicate | 0009305 | closed | giallu | Update from 1.1.1 to 1.1.2 caused email notifications to stop |
| has duplicate | 0009327 | closed | giallu | After enable email notify, all user can't recieve the notify email of "note add". |
| has duplicate | 0009457 | closed | giallu | cant get Mantis to send note added notification emails |
| related to | 0009496 | closed | dregad | Can not receive email when a new issue is added |
|
Oleg, The function definition sets p_send_email:
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 |
|
|
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). |
|
|
Hi, I'am confuse too. The $p_send_email=TRUE
! if ( !is_blank( $p_bugnote_text ) ) { was remove. This is a new change in 1.2.x branches ? |
|
|
Fixed via svn:5385 $p_send_email wasn't initialized in 1.1.x branch. |
|
|
/me wonder how this slipped in... |
|
|
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. |
|
|
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. |
|
|
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 |
|
|
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. |
|
|
Diff here: |
|
|
This is the same diff, but against 1.1.2: |
|
|
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. |
|
|
MantisBT: master-1.1.x b76e4818 2008-07-12 18:23 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 |
Affected Issues 0009309 |
|
| mod - core/bugnote_api.php | Diff File | ||