View Issue Details

IDProjectCategoryView StatusLast Update
0013718mantisbtcustomizationpublic2014-09-23 18:05
ReporterJanHegewald Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.1 
Target Version1.2.9Fixed in Version1.2.9 
Summary0013718: Custom severity not displayed cross-project
Description

Assuming issue "1" in project "A" has a custom severity "N/A" defined as described under Additional Information below, the severity string is displayed as @X@ in the view issues page :

  • severity column

Same behavior in view issue details page, looking at another issue "2" defined in project "B", relationship to issue 1

This is related to the other 'custom resolution/status not displayed cross project' issues (0013707, 0011323).

Additional Information

Sample definition for custom resolution:

severity_enum_string = '10:feature,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block,100:N/A';

TagsNo tags attached.
Attached Files
0001-Fix-cross-project-display-of-custom-severity-and-pri.patch (3,948 bytes)   
From eb011e1696afe41212121cd892e44a756c8c1fa7 Mon Sep 17 00:00:00 2001
From: Damien Regad <damien.regad@merckgroup.com>
Date: Fri, 6 Jan 2012 00:44:09 +0100
Subject: [PATCH] Fix cross-project display of custom severity and priority

When a custom severity is defined in a different project, its code
was displayed as @X@ instead of the corresponding string in the
severity column on the View Issues page.

The same problem applied to custom priorities

Fixes #13718
---
 core/columns_api.php |    4 ++--
 core/print_api.php   |   16 ++++++++--------
 my_view_inc.php      |    2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/core/columns_api.php b/core/columns_api.php
index dbba861..3acb4ac 100644
--- a/core/columns_api.php
+++ b/core/columns_api.php
@@ -931,7 +931,7 @@ function print_column_edit( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE
 function print_column_priority( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
 	echo '<td>';
 	if( ON == config_get( 'show_priority_text' ) ) {
-		print_formatted_priority_string( $p_bug->status, $p_bug->priority );
+		print_formatted_priority_string( $p_bug );
 	} else {
 		print_status_icon( $p_bug->priority );
 	}
@@ -1070,7 +1070,7 @@ function print_column_category_id( $p_bug, $p_columns_target = COLUMNS_TARGET_VI
  */
 function print_column_severity( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
 	echo '<td class="center">';
-	print_formatted_severity_string( $p_bug->status, $p_bug->severity );
+	print_formatted_severity_string( $p_bug );
 	echo '</td>';
 }
 
diff --git a/core/print_api.php b/core/print_api.php
index 764d5be..9e6304b 100644
--- a/core/print_api.php
+++ b/core/print_api.php
@@ -1143,13 +1143,13 @@ function print_bug_link( $p_bug_id, $p_detail_info = true ) {
 
 # formats the priority given the status
 # shows the priority in BOLD if the bug is NOT closed and is of significant priority
-function print_formatted_priority_string( $p_status, $p_priority ) {
-	$t_pri_str = get_enum_element( 'priority', $p_priority );
+function print_formatted_priority_string( $p_bug ) {
+	$t_pri_str = get_enum_element( 'priority', $p_bug->priority );
 	$t_priority_threshold = config_get( 'priority_significant_threshold' );
 
 	if( $t_priority_threshold >= 0 &&
-		$p_priority >= $t_priority_threshold &&
-		$p_status < config_get( 'bug_closed_status_threshold' ) ) {
+		$p_bug->priority >= $t_priority_threshold &&
+		$p_bug->status < config_get( 'bug_closed_status_threshold' ) ) {
 		echo "<span class=\"bold\">$t_pri_str</span>";
 	} else {
 		echo $t_pri_str;
@@ -1158,13 +1158,13 @@ function print_formatted_priority_string( $p_status, $p_priority ) {
 
 # formats the severity given the status
 # shows the severity in BOLD if the bug is NOT closed and is of significant severity
-function print_formatted_severity_string( $p_status, $p_severity ) {
-	$t_sev_str = get_enum_element( 'severity', $p_severity );
+function print_formatted_severity_string( $p_bug ) {
+	$t_sev_str = get_enum_element( 'severity', $p_bug->severity, auth_get_current_user_id(), $p_bug->project_id );
 	$t_severity_threshold = config_get( 'severity_significant_threshold' );
 
 	if( $t_severity_threshold >= 0 &&
-		$p_severity >= $t_severity_threshold &&
-		$p_status < config_get( 'bug_closed_status_threshold' ) ) {
+		$p_bug->severity >= $t_severity_threshold &&
+		$p_bug->status < config_get( 'bug_closed_status_threshold' ) ) {
 		echo "<span class=\"bold\">$t_sev_str</span>";
 	} else {
 		echo $t_sev_str;
diff --git a/my_view_inc.php b/my_view_inc.php
index cedc67f..c40b04b 100644
--- a/my_view_inc.php
+++ b/my_view_inc.php
@@ -461,7 +461,7 @@ echo "($v_start - $v_end / $t_bug_count)";
 	}
 
 	if( ON == config_get( 'show_priority_text' ) ) {
-		print_formatted_priority_string( $t_bug->status, $t_bug->priority );
+		print_formatted_priority_string( $t_bug );
 	} else {
 		print_status_icon( $t_bug->priority );
 	}
-- 
1.7.0.4

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
related to 0013707 closeddregad Custom resolutions not displayed cross-project 
child of 0013728 closeddregad Various display issues of custom enums cross-project 

Activities

JanHegewald

JanHegewald

2012-01-04 04:21

reporter   ~0030783

In my opinion this can be fixed by changing to things:

In print_api.php:

function print_formatted_severity_string( $p_status, $p_severity, $p_bug=null ) {
$t_sev_str = get_enum_element( 'severity', $p_severity );
$t_severity_threshold = config_get( 'severity_significant_threshold' );

to

function print_formatted_severity_string( $p_status, $p_severity, $p_bug=null ) {
$t_sev_str = get_enum_element( 'severity', $p_severity, auth_get_current_user_id(), $p_bug->project_id );
$t_severity_threshold = config_get( 'severity_significant_threshold' );

In columns_api.php:

function print_column_severity( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">';
print_formatted_severity_string( $p_bug->status, $p_bug->severity);
echo '</td>';
}

to

function print_column_severity( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">';
print_formatted_severity_string( $p_bug->status, $p_bug->severity, $p_bug );
echo '</td>';
}

Can anyone verify that these changes are working?

dregad

dregad

2012-01-04 13:39

developer   ~0030795

I'll have a look. Thanks for the bug report.

dregad

dregad

2012-01-05 18:48

developer   ~0030815

Please test the attached patch

dregad

dregad

2012-01-09 10:12

developer   ~0030877

Jan, did you get a chance to test ?

JanHegewald

JanHegewald

2012-01-09 11:09

reporter   ~0030881

Sorry for not answering. I'm going to test the patch on wednesday or thursday.

JanHegewald

JanHegewald

2012-01-11 11:47

reporter   ~0030894

I tested your patch and it seems to work for severities on 1.2.1. Priorities aren't customized here, so I could not test this point.

I also could not test on 1.2.8, because I haven't customized severities and priorities there.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036371

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master c077ca60

2012-01-05 10:44

dregad


Details Diff
Fix cross-project display of custom severity and priority

When a custom severity is defined in a different project, its code
was displayed as @X@ instead of the corresponding string in the
severity column on the View Issues page.

The same problem applied to custom priorities

Fixes 0013718
Affected Issues
0013718
mod - core/columns_api.php Diff File
mod - core/print_api.php Diff File
mod - my_view_inc.php Diff File

MantisBT: master-1.2.x 8538a5d1

2012-01-05 10:44

dregad


Details Diff
Fix cross-project display of custom severity and priority

When a custom severity is defined in a different project, its code
was displayed as @X@ instead of the corresponding string in the
severity column on the View Issues page.

The same problem applied to custom priorities

Fixes 0013718
Affected Issues
0013718
mod - core/columns_api.php Diff File
mod - core/print_api.php Diff File
mod - my_view_inc.php Diff File