Bugnote email

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
incrediblehelp
Posts: 10
Joined: 27 Jun 2008, 03:31

Bugnote email

Post by incrediblehelp »

No matter what I try it seems I cant get users to be emailed updates when users add bug notes. I have the following lines added to the config_inc.php file:

Code: Select all

$g_notify_flags['bugnotes']['threshold_min'] = DEVELOPER;
$g_notify_flags['bugnotes']['threshold_max'] = ADMINISTRATOR;
Shouldnt that work?
vzw614
Posts: 143
Joined: 15 May 2008, 14:59

Re: Bugnote email

Post by vzw614 »

Take a look at $g_default_notify_flags

In the config_defaults_inc.php file I have the 'threshold_min' and 'threshold_max' are both set to NOBOBY (which is 100). I copied that setting to my config_inc and changed 'threshold_min' to ANYBODY (which is 0).

Give that a try and see if that fixes the problem. If it does let me know and I will submit a bug report that the setting is wrong in config_default_inc.php
LeChuck
Posts: 5
Joined: 30 Apr 2007, 14:47

Re: Bugnote email

Post by LeChuck »

Hi,

I ran into the exact same problem today (we upgraded mantis to version 1.1.2 this weekend) and are dealing with some issues today.
The suggestion by incrediblehelp didn't work for me. In fact I think these default settings are correct because they prevent mails by default and can be overwritten later with actual parameters ($g_notify_flags).
After investigating the code (and I'm not an php expert) I think I found a bug in mantis code.
bugnote_add.php calls a function bugnote_add in core\bugnote_api.php (see line 55 of bugnote_add.php).

core\bugnote_api.php defines the function "bugnote_add". At the end of this function (line 167 and following) there is code to actual send emails. Two conditions must be met.
1) $p_send_email (a parameter obviously determining whether emails should be sent) must be true
2) $p_bugnote_text must not be null
But the parameter $p_send_mail is never defined and thus always false!
My guess is that this parameter should be implemented as a default parameter as in core\user_api.php (see line 1169).
So I modified line 102 of core\bugnote_api.php accordingly from

Code: Select all

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 ) {
to

Code: Select all

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 ) {
and now it works.

Hope that helps and works for you too.
incrediblehelp
Posts: 10
Joined: 27 Jun 2008, 03:31

Re: Bugnote email

Post by incrediblehelp »

Yup that works, thanks for the help guys
Post Reply