View Issue Details

IDProjectCategoryView StatusLast Update
0022828mantisbtcustom fieldspublic2017-05-12 18:03
ReporterChris_Z Assigned Toatrol  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version2.4.0 
Summary0022828: Numeric custom field produces invalid Excel xml
Description

Numeric custom field (defined as in attached screenshot) produces following invalid Excel output:

&lt;Cell >&lt;Data ss:Type=&quot;Number&quot;><p>60</p>&lt;/Data>&lt;/Cell>

where expected one would be:

&lt;Cell >&lt;Data ss:Type=&quot;Number&quot;>60&lt;/Data>&lt;/Cell>

I am using MySQL and Excel 2010.

Steps To Reproduce

I found the following workaround by amending excel_api.php:

function excel_format_custom_field( $p_issue_id, $p_project_id, $p_custom_field ) {
    $t_field_id = custom_field_get_id_from_name( $p_custom_field );

    if( $t_field_id === false ) {
        return excel_prepare_string( '@' . $p_custom_field . '@' );
    }

    if( custom_field_is_linked( $t_field_id, $p_project_id ) ) {
        $t_def = custom_field_get_definition( $t_field_id );

        if ( $t_def['type'] == CUSTOM_FIELD_TYPE_NUMERIC ) {
// CZ, 2017.05.02 - commented out
//          return excel_prepare_number( string_custom_field_value( $t_def, $t_field_id, $p_issue_id ) );
// CZ, 2017.05.02 - workaround for numeric custom fields returning &quot;number&quot; as &quot;<p>number</p>&quot;
            $t_workaround_string = string_custom_field_value( $t_def, $t_field_id, $p_issue_id );
            $t_workaround_number = str_replace( array( '&lt;', '>', 'p', '/' ), array( '', '', '', '' ), $t_workaround_string );
            return excel_prepare_number( $t_workaround_number );
        }

        return excel_prepare_string( string_custom_field_value( $t_def, $t_field_id, $p_issue_id ) );
    }

    # field is not linked to project
    return excel_prepare_string( '' );
}
TagsNo tags attached.

Relationships

duplicate of 0022428 closedvboctor CSV and Excel exports with markdown on 

Activities

Chris_Z

Chris_Z

2017-05-02 13:09

reporter  

Snapshot-2017-05-02-190130.png (39,277 bytes)   
Snapshot-2017-05-02-190130.png (39,277 bytes)   
atrol

atrol

2017-05-02 13:26

developer   ~0056761

I assume you have Markdown enabled and this is a duplicate of 0022428.
Please reopen the issue if Markdown is not enabled.

Chris_Z

Chris_Z

2017-05-02 13:35

reporter   ~0056762

I assume you have Markdown enabled

Yes, I have.
Only numeric custom fields are affected.
Standard numeric fields and custom non-numeric fields are not affected.

Issue History

Date Modified Username Field Change
2017-05-02 13:09 Chris_Z New Issue
2017-05-02 13:09 Chris_Z File Added: Snapshot-2017-05-02-190130.png
2017-05-02 13:26 atrol Assigned To => atrol
2017-05-02 13:26 atrol Status new => resolved
2017-05-02 13:26 atrol Resolution open => duplicate
2017-05-02 13:26 atrol Note Added: 0056761
2017-05-02 13:26 atrol Relationship added duplicate of 0022428
2017-05-02 13:35 Chris_Z Note Added: 0056762
2017-05-12 18:03 atrol Status resolved => closed