View Issue Details

IDProjectCategoryView StatusLast Update
0009509mantisbtcustom fieldspublic2009-01-15 11:26
Reportermthibeault Assigned Tograngeway  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0a2 
Fixed in Version1.2.0a3 
Summary0009509: Custom fields with spaces are not handled correctly
Description

When a columns list string is converted to an array, the column names are modified in a way that spaces are not handled correctly. In fact, the spaces are deleted and then the custom field name cannot be associated with any existing custom field.

Additional Information

Function columns_string_to_array in columns_api.php:120-132 should be:

function columns_string_to_array( $p_string ) {
$t_string = strtolower( $p_string );

$t_columns = explode( ',', $t_string );
for($i = 0; $i < count($t_columns); $i++) {
    $t_columns[$i] = trim($t_columns[$i]);
}

return $t_columns;

}

Tagspatch
Attached Files
custom_field_space.patch (643 bytes)   
Index: mantisbt/core/columns_api.php
===================================================================
--- mantisbt/core/columns_api.php	(revision 5503)
+++ mantisbt/core/columns_api.php	(working copy)
@@ -123,10 +123,12 @@
 	 * @returns The array with all column names lower case.
 	 */
 	function columns_string_to_array( $p_string ) {
-		$t_string = str_replace( ' ', '', $p_string );
-		$t_string = strtolower( $t_string );
+		$t_string = strtolower( $p_string );
 
 		$t_columns = explode( ',', $t_string );
+		for($i = 0; $i < count($t_columns); $i++) {
+			$t_columns[$i] = trim($t_columns[$i]);
+		}
 
 		return $t_columns;
 	}
custom_field_space.patch (643 bytes)   

Activities

giallu

giallu

2008-08-11 11:00

reporter   ~0019109

could you please attach a patch produced by the "svn diff" command?

mthibeault

mthibeault

2008-08-11 12:13

reporter   ~0019111

Patch added.

karotos

karotos

2008-11-21 04:40

reporter   ~0019967

Checked it in my production installation and we have no problems so far.
The patch is pretty straight forward.
Thanks mthibeault

grangeway

grangeway

2008-11-30 07:41

reporter   ~0020153

Patch commited to GIT

Related Changesets

MantisBT: master 0a2a806a

2008-11-30 07:40

Paul Richards


Details Diff
Fix 0009509: Custom fields with spaces are not handled correctly Affected Issues
0009509
mod - core/columns_api.php Diff File