View Issue Details

IDProjectCategoryView StatusLast Update
0022428mantisbtmarkdownpublic2017-05-30 07:46
Reporteradelav1Assigned 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.

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

View 2 revisions

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 23:43:55

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
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

Issue History

Date Modified Username Field Change
2017-02-28 06:15 adelav1 New Issue
2017-02-28 06:23 atrol Status new => confirmed
2017-02-28 06:53 dregad Description Updated View Revisions
2017-02-28 06:54 dregad Relationship added related to 0022180
2017-05-02 13:26 atrol Relationship added has duplicate 0022828
2017-05-04 09:39 didaquis File Added: Captura.JPG
2017-05-04 09:39 didaquis File Added: Captura 2.JPG
2017-05-04 09:39 didaquis Note Added: 0056773
2017-05-06 15:38 vboctor Assigned To => vboctor
2017-05-06 15:38 vboctor Status confirmed => assigned
2017-05-06 15:38 vboctor Note Added: 0056781
2017-05-06 15:45 vboctor Note Added: 0056782
2017-05-06 15:45 vboctor Note Edited: 0056782 View Revisions
2017-05-06 15:46 vboctor Target Version => 2.4.1
2017-05-09 03:41 atrol Relationship added has duplicate 0022848
2017-05-15 00:38 vboctor Note Added: 0056856
2017-05-15 00:39 vboctor Severity minor => major
2017-05-20 14:21 vboctor Changeset attached => MantisBT master-2.4 8dad4e18
2017-05-20 14:21 vboctor Status assigned => resolved
2017-05-20 14:21 vboctor Resolution open => fixed
2017-05-20 14:21 vboctor Fixed in Version => 2.4.1
2017-05-20 16:10 vboctor Status resolved => closed
2017-05-25 06:01 atrol Relationship added related to 0022926
2017-05-28 05:11 atrol Relationship added related to 0022937
2017-05-30 07:46 atrol Relationship added related to 0022950