View Issue Details

IDProjectCategoryView StatusLast Update
0025174mantisbtexcelpublic2019-03-16 20:20
Reporterjoao.deangeli Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.8 
Target Version2.20.0Fixed in Version2.20.0 
Summary0025174: Float custom field saved as String in XML-Excel export
Description

From version 1.3.0 to the latest version (2.20.0), the exported xml file (Excel) writes the String type when the exported custom field is of type Float.
When the custom field is numeric, the export works correctly.

Steps To Reproduce

Export an xml-excel containing a float custom field.
Open the xml file in a text editor.

The contents of the file will have:
<Cell ><Data ss:Type="String">123.45</Data></Cell>

Rather than:
<Cell ><Data ss:Type="Number">123.45</Data></Cell>

Additional Information

Proposed solution:

To correct, in the file "core/excel_api.php", replace the line:
if ( $t_def['type'] == CUSTOM_FIELD_TYPE_NUMERIC && is_numeric( $t_value ) ) {
by the line below:
if ( ( $t_def['type'] == CUSTOM_FIELD_TYPE_NUMERIC || $t_def['type'] == CUSTOM_FIELD_TYPE_FLOAT ) && is_numeric( $t_value ) ) {

TagsNo tags attached.

Activities

Related Changesets

MantisBT: master 7b26ae1b

2019-01-08 15:53

atrol


Details Diff
Export FLOAT custom fields as numbers to Excel

Fixes 0025174
Affected Issues
0025174
mod - core/excel_api.php Diff File