View Issue Details

IDProjectCategoryView StatusLast Update
0022428mantisbtmarkdownpublic2017-05-30 07:46
Reporteradelav1 Assigned Tovboctor  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version2008R2
Product Version2.2.0 
Target Version2.4.1Fixed in Version2.4.1 
Summary0022428: CSV and Excel exports with markdown on
Description

With markdown enabled, in csv and excel exports, custom field values are rendered as html.

XXX becomes <p>XXX</p>

TagsNo tags attached.
Attached Files

Relationships

related to 0022180 new Markdown issues following implementation in 0017920 
has duplicate 0022828 closedatrol Numeric custom field produces invalid Excel xml 
has duplicate 0022848 closedatrol Export to excel generates error 
related to 0022926 closedvboctor Custom Fields - Date: Field does not show date (view.php), shows other text 
related to 0022937 closedvboctor Custom fields of type Email are not properly displayed 
related to 0022950 closedvboctor Custom Fields of Type Text showing Link (Url) as Text only 

Activities

didaquis

didaquis

2017-05-04 09:39

reporter   ~0056773

Same situation for me on MantisBT 2.3.2master-2.3-afc31a6

Captura.JPG (55,299 bytes)   
Captura.JPG (55,299 bytes)   
Captura 2.JPG (67,422 bytes)   
Captura 2.JPG (67,422 bytes)   
vboctor

vboctor

2017-05-06 15:38

manager   ~0056781

This mainly happens with custom fields and it also fully corrupts the export file if there is a numeric custom field.

vboctor

vboctor

2017-05-06 15:45

manager   ~0056782

Last edited: 2017-05-06 15:45

This is caused by string_custom_field_value() calling string_display_links() which seems odd, since this is a display operation rather than data retrieval operation.

The fix for this should include the following:

  • Completely remove this call or at least make it optional.
  • When exporting a field we should only export it as numeric if it is of type numeric and the value is numeric (defense in depth).

Check CSV as well, since it may be affected by this bug.

vboctor

vboctor

2017-05-15 00:38

manager   ~0056856

PR: https://github.com/mantisbt/mantisbt/pull/1107

Related Changesets

MantisBT: master-2.4 8dad4e18

2017-05-14 19:43

vboctor


Details Diff
Fix CSV and Excel export when markdown is enabled

The output for CSV and Excel included paragraph html tags which polluted
the output and corrupted Excel output when there are numeric custom fields.

This was caused by calling html processing when getting the value of custom fields.

The fix is to have the retrieval of custom field values not process it for any output
and have the calling code do the appropriate processing. The code also now does
processing based on the custom field type rather than treating types all as string.

Fixes 0022428
Affected Issues
0022428
mod - core/cfdefs/cfdef_standard.php Diff File
mod - core/classes/MantisColumn.class.php Diff File
mod - core/csv_api.php Diff File
mod - core/custom_field_api.php Diff File
mod - core/excel_api.php Diff File
mod - csv_export.php Diff File
mod - excel_xml_export.php Diff File