View Issue Details

IDProjectCategoryView StatusLast Update
0003914mantisbtfeaturepublic2004-07-07 18:47
Reportermalaussena Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.18.3 
Fixed in Version0.19.0a1 
Summary0003914: CSV Export : incorrect date_submitted and last_updated
Description

CSV export returns wrong date in date_submitted and last_updated.

TagsNo tags attached.
Attached Files
test2.csv (1,199 bytes)
test.csv (1,199 bytes)

Activities

malaussena

malaussena

2004-06-05 18:15

reporter   ~0005658

Patch :

cvs diff csv_api.php (in directory D:\CVSREPO\root1\mantisbt\core)
Index: csv_api.php

RCS file: /cvsroot/mantisbt/mantisbt/core/csv_api.php,v
retrieving revision 1.3
diff -r1.3 csv_api.php
1c1
< <?php

<?php
158c158
< return date( config_get( 'short_date_format' ), $p_date_submitted );

          return date( config_get( 'short_date_format', $p_date_submitted ) );

194c194
< return date( config_get( 'short_date_format' ), $p_last_updated );

          return date( config_get( 'short_date_format', $p_last_updated ) );

220c220
< ?>
\ No newline at end of file

int2str

int2str

2004-06-05 18:38

reporter   ~0005659

malaussena,

what exactly is the problem with the date? Can you specify your bug report some more please?

Also, can you post your patch in unified diff format? I'm trying to figure out what you were tryuing to do, but I'm not sure which is the resulting revision.

This:
return date( config_get( 'short_date_format', $p_date_submitted ) );

Is certainly incorrect. config_get() takes only one parameter (in this case).

malaussena

malaussena

2004-06-06 01:20

reporter   ~0005660

Yes. You're rigth :-(

The bug is date_submitted returned as '01/01/1970' (in french format) in the CSV export which is the default value, not the good one.
In mantis_bug_table, date_submitted is '2004-06-05 15:50:36'.

test2.csv is the export with wrong date.

int2str

int2str

2004-06-06 02:11

reporter   ~0005661

Whats your short_date_format set to?

malaussena

malaussena

2004-06-06 12:56

reporter   ~0005663

short date format is set in config_inc.php :

$g_short_date_format = 'd-m-y';

test.csv is the export file without my "wrong" fix ;-), with 01-01-70 in submitted-date.

malaussena

malaussena

2004-06-07 14:38

reporter   ~0005665

I've tried with short-date-format set to the default value (defaults_config_inc.php).
I have the same bug.
Submitted_date still reported as 01-01-70 in the CSV export.
In the bug_view_page.php, date_submitted is correct : 06-05-04 15:50

I have the same problem with 2 install of Mantis 0.18.3

malaussena

malaussena

2004-06-07 16:10

reporter   ~0005666

Rappel envoyé à int2str

I've tried to debug csv_export.php.

I've modified export rows like that :

# export the rows
foreach ( $rows as $row ) {
    $t_values = array();
    foreach ( $t_columns as $key => $title ) {

--> echo $key ;
--> echo ' ';
--> echo $row[$key];
--> echo $t_nl ;

check if column should be visible

        if ( !isset( $row[$key] ) ) {
            $t_values[] = '';
            continue;
        }

and I get this :

id 1
project_id 1
reporter_id 2
handler_id 0
priority 30
severity 10
reproducibility 10
version
projection 10
category
date_submitted 2004-06-05 15:50:36
eta 10
os
os_build
platform
view_state 10
last_updated 1086443436
summary L’ami « mai »
status 10
resolution 10
duplicate_id 0
fixed_in_version

As you can see, last_updated is returned as 1086443436 but date_submitted is returned as 2004-06-05 15:50:36.

So, in csv_export.php,

    $t_function = 'csv_format_' . $key;
    $t_values[] = $t_function( $row[ $key ] );

can't return a good value for date_submitted.

But... what's the problem ?

Regards.

Eric.

malaussena

malaussena

2004-06-07 16:49

reporter   ~0005667

Rappel envoyé à int2str

I think I found a fix for my problem.

In \core\filter_api.php I've modified :

$query2 = "SELECT DISTINCT $t_select, UNIX_TIMESTAMP(last_updated) as last_updated
$t_from
$t_join
$t_where";

to :

$query2 = "SELECT DISTINCT $t_select, UNIX_TIMESTAMP(date_submitted) as date_submitted, UNIX_TIMESTAMP(last_updated) as last_updated
$t_from
$t_join
$t_where";

It seems ok for me, now...

Do you agree with me ?

malaussena

malaussena

2004-06-08 15:50

reporter   ~0005674

In \core\filter_api.php a new correction to be compatible with the Text Search in view_all_bug_page.php :

$query2 = "SELECT DISTINCT $t_select, UNIX_TIMESTAMP(mantis_bug_table.date_submitted) as date_submitted, UNIX_TIMESTAMP(last_updated) as last_updated
$t_from
$t_join
$t_where";

grangeway

grangeway

2004-06-08 17:48

reporter   ~0005675

UNIX_TIMESTAMP isn't used in CVS head, so this issue problem only occurs in the current release.

As far as i can tell, latest cvs does not have this issue.

malaussena

malaussena

2004-06-10 15:04

reporter   ~0005683

I do agree with you. This only occurs in 0.18.3... but it is the last release.
At work, I can't install a CVS version ! :-(
So I had to correct this bug by myself...

vboctor

vboctor

2004-06-21 06:48

manager   ~0005745

This is already fixed in 0.19.0.