View Issue Details

IDProjectCategoryView StatusLast Update
0009419mantisbtcustomizationpublic2019-12-13 18:06
ReporterJoeMamma Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
PlatformVMWare virtual machineOSRedhat Linux 
Product Version1.2.0a1 
Summary0009419: Workflow and status enumerated string customizations not being recognized
Description

The customizations to $g_status_enum_string are not recognized and displayed by this build (see above).

The same configuration files (config_inc.php, custom_constant_inc.php) work correctly on version 1.2.0a1.

I believe the custom string is being overridden by the "lang_get" functions, which it should not ...

Steps To Reproduce

In custom_constant_inc.php := define('DEFERRED', 100);

In config_inc.php := $g_status_enum_string=
"10:NEW,20:FEEDBACK,30:ACKNOWLEDGED,40:CONFIRMED,50:ASSIGNED,80:RESOLVED,90:CLOSED,100:DEFERRED";

TagsNo tags attached.

Activities

JoeMamma

JoeMamma

2008-07-18 15:30

reporter   ~0018611

I added these lines to "lang_get" function to solve my problem. Sort of...

    if ( isset($GLOBALS[ 'g_' . $p_string ] ) ) {
        return config_get_global( $p_string ); # don't trump a configured global with language string nonsense...
    }

2008-08-04 10:59

 

mantis_patch-08-01.diff (5,618 bytes)   
Index: bug_report_page.php
===================================================================
--- bug_report_page.php	(revision 5475)
+++ bug_report_page.php	(working copy)
@@ -215,16 +215,31 @@
 		</select>
 	</td>
 </tr>
+
+
 <?php
 	}
 ?>
 
+<!-- assign (if allowed) -->
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category">
+		<?php echo lang_get( 'assign_to' ) ?>
+	</td>
+	<td>
+		<select <?php echo helper_get_tab_index() ?> name="handler_id">
+			<option value="0" selected="selected"></option>
+			<?php print_assign_to_option_list( $f_handler_id ) ?>
+		</select>
+	</td>
+</tr>
+
 <!-- spacer -->
+
 <tr class="spacer">
 	<td colspan="2"></td>
-</tr>
+</tr> 
 
-
 <!-- Summary -->
 <tr <?php echo helper_alternate_class() ?>>
 	<td class="category">
Index: core/helper_api.php
===================================================================
--- core/helper_api.php	(revision 5475)
+++ core/helper_api.php	(working copy)
@@ -94,11 +94,12 @@
 	# Given a enum string and num, return the appropriate string
 	function get_enum_element( $p_enum_name, $p_val ) {
 		$config_var = config_get( $p_enum_name.'_enum_string' );
+		return get_enum_to_string ( $config_var, $p_val );
 		$string_var = lang_get(  $p_enum_name.'_enum_string' );
 
 		# use the global enum string to search
-		$t_arr			= explode_enum_string( $config_var );
-		$t_arr_count	= count( $t_arr );
+		$t_arr = explode_enum_string( $config_var );
+		$t_arr_coun = count( $t_arr );
 		for ( $i=0; $i < $t_arr_count ;$i++ ) {
 			$elem_arr = explode_enum_arr( $t_arr[$i] );
 			if ( $elem_arr[0] == $p_val ) {
@@ -505,4 +506,4 @@
 
 		return (int)$t_min;
 	}
-?>
\ No newline at end of file
+?>
Index: manage_config_workflow_page.php
===================================================================
--- manage_config_workflow_page.php	(revision 5475)
+++ manage_config_workflow_page.php	(working copy)
@@ -67,7 +67,7 @@
 
     	# prepopulate new bug state (bugs go from nothing to here)
     	$t_submit_status_array = config_get( 'bug_submit_status' );
-    	$t_new_label = get_enum_to_string( lang_get( 'status_enum_string' ), NEW_ );
+    	$t_new_label = get_enum_to_string( config_get( 'status_enum_string' ), NEW_ );
     	if ( is_array( $t_submit_status_array ) ) {
     		# @@@ (thraxisp) this is not implemented in bug_api.php
     		foreach ($t_submit_status_array as $t_access => $t_status ) {
@@ -167,7 +167,7 @@
 		echo "\n<tr>";
 		foreach( $t_enum_status as $t_status ) {
 			$t_entry_array = explode_enum_arr( $t_status );
-			echo '<td class="form-title" style="text-align:center">&nbsp;' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $t_entry_array[0] ) ) . '&nbsp;</td>';
+			echo '<td class="form-title" style="text-align:center">&nbsp;' . string_no_break( get_enum_to_string( config_get( 'status_enum_string' ), $t_entry_array[0] ) ) . '&nbsp;</td>';
 		}
 			echo '<td class="form-title" style="text-align:center">' . lang_get( 'custom_field_default_value' ) . '</td>';
 		echo '</tr>' . "\n";
@@ -176,7 +176,7 @@
 	function capability_row( $p_from_status ) {
 		global $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project, $t_can_change_workflow;
 		$t_enum_status = get_enum_to_array( config_get( 'status_enum_string' ) );
-		echo '<tr ' . helper_alternate_class() . '><td>' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $p_from_status ) ) . '</td>';
+		echo '<tr ' . helper_alternate_class() . '><td>' . string_no_break( get_enum_to_string( config_get( 'status_enum_string' ), $p_from_status ) ) . '</td>';
 		foreach ( $t_enum_status as $t_to_status_id => $t_to_status_label ) {
 			echo show_flag( $p_from_status, $t_to_status_id );
 		}
@@ -204,7 +204,7 @@
             print_enum_string_option_list( 'status', $t_project );
             echo '</select>';
         } else {
-            echo get_enum_to_string( lang_get( 'status_enum_string' ), $t_project );
+            echo get_enum_to_string( config_get( 'status_enum_string' ), $t_project );
         }
         echo ' </td>';
 		echo '</tr>' . "\n";
@@ -254,7 +254,7 @@
 			echo '</select> </td>';
 			$t_can_change_flags = true;
 		} else {
-			echo '<td' . $t_colour . '>' . get_enum_to_string( lang_get( 'status_enum_string' ), $t_project ) . '&nbsp;</td>';
+			echo '<td' . $t_colour . '>' . get_enum_to_string( config_get( 'status_enum_string' ), $t_project ) . '&nbsp;</td>';
 			echo '<td>' . get_enum_to_string( lang_get( 'access_levels_enum_string' ), config_get_access( $p_threshold ) ) . '&nbsp;</td>';
 		}
 
@@ -304,7 +304,7 @@
 		}
 
 		foreach ( $t_enum_status as $t_status => $t_status_label) {
-			echo '<tr ' . helper_alternate_class() . '><td width="30%">' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $t_status ) ) . '</td>';
+			echo '<tr ' . helper_alternate_class() . '><td width="30%">' . string_no_break( get_enum_to_string( config_get( 'status_enum_string' ), $t_status ) ) . '</td>';
 			if ( NEW_ == $t_status ) {
 				$t_level = $t_project_new;
 				$t_can_change = ( $t_access >= config_get_access( 'report_bug_threshold' ) );
@@ -359,7 +359,7 @@
 	$t_status_arr  = get_enum_to_array( $t_enum_status );
 
 	$t_extra_enum_status = '0:non-existent,' . $t_enum_status;
-	$t_lang_enum_status = '0:' . lang_get( 'non_existent' ) . ',' . lang_get( 'status_enum_string' );
+	$t_lang_enum_status = '0:' . lang_get( 'non_existent' ) . ',' . config_get( 'status_enum_string' );
 	$t_all_status = explode( ',', $t_extra_enum_status);
 
 	# gather all versions of the workflow
mantis_patch-08-01.diff (5,618 bytes)   
JoeMamma

JoeMamma

2008-08-04 11:05

reporter   ~0019021

I have attached a patch file which avoids locale processes on the "enum_string" variables. These are configurable options, and should not subject to language processing.

thraxisp

thraxisp

2008-08-04 13:47

reporter   ~0019027

This is already supported. You need to complete the modifications shown in http://www.mantisbt.org/manual/manual.customizing.mantis.customizing.status.values.php to complete adding the new status.

JoeMamma

JoeMamma

2008-12-19 18:22

reporter   ~0020434

Since these enumerated values are not excluded from being saved and stored in the database (because the can and do get stored there), shouldn't those configuration settings override the language files? This provides for different enumerated values for different projects (although the enumerated colors need to be adjusted, too).

dregad

dregad

2019-12-03 09:58

developer   ~0063179

We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem still exists, do not hesitate to reopen the issue.

[1] http://www.mantisbt.org/download.php

Issue History

Date Modified Username Field Change
2008-07-18 11:44 JoeMamma New Issue
2008-07-18 15:30 JoeMamma Note Added: 0018611
2008-08-04 10:59 JoeMamma File Added: mantis_patch-08-01.diff
2008-08-04 11:05 JoeMamma Note Added: 0019021
2008-08-04 13:47 thraxisp Note Added: 0019027
2008-08-04 13:47 thraxisp Status new => feedback
2008-12-19 18:22 JoeMamma Note Added: 0020434
2019-12-03 09:58 dregad Assigned To => dregad
2019-12-03 09:58 dregad Status feedback => resolved
2019-12-03 09:58 dregad Resolution open => no change required
2019-12-03 09:58 dregad Note Added: 0063179
2019-12-13 18:06 atrol Status resolved => closed