View Issue Details

IDProjectCategoryView StatusLast Update
0011088mantisbtemailpublic2010-02-22 14:34
Reporterdhx Assigned Torombert  
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0 
Target Version1.2.0Fixed in Version1.2.0 
Summary0011088: Update emails show @0@ instead of the access level of each bugnote author
Description

This is reproducible with the MantisBT.org bug tracker.

For emails in the format:
"The following issue has been UPDATED."

Bugnotes listed in the email will show @0@ as the access level for each of the bugnote authors.

Example:

Additional Information:
I've supplied a patch to correct this issue.
======================================================================


(0023405) dhx (@0@) - 2009-10-27 07:51
http://www.mantisbt.org/bugs/view.php?id=11021#c23405


Thanks for the patch. I've committed it to the 1.2.x and 1.3.x branches.

Issue History
Date Modified Username Field Change

For other types of notifications such as new notes or new people being added to the monitor list, the access level string is rendered correctly.

Tagsenum, patch
Attached Files
0001-Issue-11088-Update-emails-show-0-instead-of-the-acce.patch (1,555 bytes)   
From a00a594a82d7cd4bf9df351727c2954cc5089a5b Mon Sep 17 00:00:00 2001
From: Robert Munteanu <robert.munteanu@gmail.com>
Date: Mon, 9 Nov 2009 23:58:11 +0200
Subject: [PATCH] Issue #11088: Update emails show @0@ instead of the access level of each bugnote author

Update email_format_bug_message to pass in the project id to access_get_project_level
for the bugnote reporter instead of relying on helper_get_current_project() to
guess the correct one.
---
 core/email_api.php |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/core/email_api.php b/core/email_api.php
index e824206..c8944b8 100644
--- a/core/email_api.php
+++ b/core/email_api.php
@@ -1305,7 +1305,7 @@ function email_format_bug_message( $p_visible_bug_data ) {
 		}
 
 		if( user_exists( $t_bugnote->reporter_id ) ) {
-			$t_access_level = access_get_project_level( null, $t_bugnote->reporter_id );
+			$t_access_level = access_get_project_level( $p_visible_bug_data['email_project_id'] , $t_bugnote->reporter_id );
 			$t_access_level_string = ' (' . get_enum_element( 'access_levels', $t_access_level ) . ') - ';
 		} else {
 			$t_access_level_string = '';
@@ -1385,6 +1385,7 @@ function email_build_visible_bug_data( $p_user_id, $p_bug_id, $p_message_id ) {
 	}
 
 	$t_bug_data['email_reporter'] = user_get_name( $row['reporter_id'] );
+	$t_bug_data['email_project_id'] = $row['project_id'];
 	$t_bug_data['email_project'] = project_get_field( $row['project_id'], 'name' );
 
 	$t_category_name = category_full_name( $row['category_id'], false );
-- 
1.6.4.2

Activities

rombert

rombert

2009-11-09 17:01

reporter   ~0023627

If anyone is bored enough to try this (untested - I don't use email notifications ) patch, please do so.

dhx

dhx

2009-12-17 19:54

reporter   ~0023931

Thanks Robert, your patch works fine so I committed it :)

rombert

rombert

2009-12-18 03:20

reporter   ~0023932

Now that's just scary. Glad to hear it works though :-)

Related Changesets

MantisBT: master-1.2.x a27f6316

2009-11-09 16:58

rombert

Committer: dhx


Details Diff
Issue 0011088: Update emails show @0@ instead of the access level of each bugnote author

Update email_format_bug_message to pass in the project id to access_get_project_level
for the bugnote reporter instead of relying on helper_get_current_project() to
guess the correct one.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0011088
mod - core/email_api.php Diff File

MantisBT: master e35d857f

2009-11-09 16:58

rombert

Committer: dhx


Details Diff
Issue 0011088: Update emails show @0@ instead of the access level of each bugnote author

Update email_format_bug_message to pass in the project id to access_get_project_level
for the bugnote reporter instead of relying on helper_get_current_project() to
guess the correct one.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0011088
mod - core/email_api.php Diff File