View Issue Details

IDProjectCategoryView StatusLast Update
0010544mantisbtemailpublic2009-06-23 15:28
Reporterjonathh Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.7 
Target Version1.2.0rc1Fixed in Version1.2.0rc1 
Summary0010544: Email bug note ordering.
Description

As per an email conversation i recently had (with myself so far) on the mantis mailing list the sort order of notes in emails is not respected - unlike the NUMBER of notes attached.

See my email:

Hi, I am playing with the number of
bug notes emailed and the order in which they appear. I have
found the following

$g_default_bugnote_order
= 'DESC';
$g_default_email_bugnote_limit
= 2;

BUT the sort order does NOT apply to emails. I can not seem
to change the order in which bugs appear in emails. Is this
a bug? I really want to limit the number of notes emailed
and have the new ones at the top.

Secondly these changes - although default no not seem to
override an existing users settings even if that user has
never changed them. Is only applied to new users/users that
reset prefs. Is this desirable?

Hi all i am now quite confident this is a bug. i have been playing about with the emai_API.php and notice this call

$t_user_bugnote_order = user_pref_get_pref ( $p_user_id, 'bugnote_order' );

in function email_build_visible_bug_data

The value inserted into t_user_bugnote_order MUST be incorrect as when i hard code values of ASC or DESC as follows

$t_bug_data['bugnotes'] = bugnote_get_all_visible_bugnotes( $p_bug_id, $t_user_access_level, 'DESC', $t_user_bugnote_limit );

I get the desired effect - i.e. the bug note ordering in emails actually changes.

Unfortunately I think I have hit my limit of testing as I dont know how to get debug output of out mantis. I am going to raise this as an issue.

TagsNo tags attached.

Relationships

related to 0009779 closeddregad Problem when adding a bugnote 
related to 0009630 closeddregad Sort bugnotes in notifocation emails desc 
related to 0005449 closedatrol Can't limit the number of bugnotes in the e-mail Mantis sends? 
has duplicate 0010704 closedjreese Notes in emails not sorted correctly 

Activities

jreese

jreese

2009-06-04 11:51

reporter   ~0022045

Fix committed to master branch.

Related Changesets

MantisBT: master 4fc213a3

2009-06-02 15:35

jreese


Details Diff
Fix 0010544: Fix bugnote order and limit when generating emails.

Reworked the original implementation of bugnote_get_all_bugnotes() to
not care about order or limits, and just cache all the bugnotes in a
simplified format. Updated bugnote_get_visible_bugnotes() to now
expect a full list of bugnotes, and correctly handle the display order
and limit each time called.
Affected Issues
0010544
mod - core/bugnote_api.php Diff File