On windows, export bug list to CSV breaks because of extra line breaks

RESOLVED FIXED in Bugzilla 3.2

Status

()

Bugzilla
Query/Bug List
--
major
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: Yann, Assigned: Frédéric Buclin)

Tracking

Bugzilla 3.2
All
Windows XP
Bug Flags:
blocking3.4 -
approval3.2 +
blocking3.2.4 -
blocking3.2.5 +

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
Build Identifier: Bugzilla 3.2

When exporting a buglist to CSV in Windows 2k3 (ActiveState 5.10 build 1004), I get one extra line break for every loop/check (FOR EACH, IF) in template list.csv. So every bug takes 3/4 lines per column exported!

This was not happening when using Bugzilla 3.0 and Active State 5.8.8 build 822. Is this a known issue of TT or other module?

To fix, I had to remove all line breaks and make conditions happen on one line:

[% FOREACH bug = bugs %]
[% bug.bug_id %][% FOREACH column = displaycolumns %][% colsepchar %][% IF column == "opendate" OR column == "changeddate" %][% rawcolumn = column.replace("date", "time") %][% bug.$column = date.format(bug.$rawcolumn, "%Y-%m-%d %H:%M:%S") %][% ELSIF column == 'bug_status' %][% bug.$column = get_status(bug.$column) %][% ELSIF column == 'resolution' %][%- bug.$column = get_resolution(bug.$column) %][% END %][% bug.$column FILTER csv %][% END %][% END %]


Reproducible: Always

Steps to Reproduce:
1. Create a search
2. Click on CSV to export bug list as CSV
3.
Actual Results:  
For each bug, a column is display every 3 lines.

Expected Results:  
Columns should be displaying next to each other, no below each other.
(Reporter)

Updated

9 years ago
Version: unspecified → 3.2
(Reporter)

Comment 1

9 years ago
Not sure if this is related to bug 467920

Comment 2

9 years ago
Yeah, this is almost certainly related to bug 467920. You know, I bet the problem is that we read templates in a binmode, now. Maybe we have to add a :crlf filter to the IO layer that we read templates through.

Comment 3

9 years ago
Bug 464992 comment 41: related bug can be remedied by upgrading Perl to 5.10.0.
(Reporter)

Comment 4

9 years ago
(In reply to comment #3)
> Bug 464992 comment 41: related bug can be remedied by upgrading Perl to 5.10.0.

Per my description, I already run perl 5.10: "(ActiveState 5.10 build 1004)"

Comment 5

9 years ago
Unable to reproduce on 5.10 and Win XP myself.

Reported two more times on mozilla.support.bugzilla.
(In reply to comment #5)
> Unable to reproduce on 5.10 and Win XP myself.
> 
> Reported two more times on mozilla.support.bugzilla.

Ok, i'll test on my server.

(In reply to comment #4)
> Per my description, I already run perl 5.10: "(ActiveState 5.10 build 1004)"

Could you paste the result of my script?
https://bugzilla.mozilla.org/attachment.cgi?id=356690
I could not reproduce this on ActivePerl 5.10 (1004) on Win2k3.
With saving en\default\list\list.csv.tmpl with CrLf, the same. (not reproduced).

  Locally applied patches:
        ActivePerl Build 1004 [287188]
        33741 avoids segfaults invoking S_raise_signal() (on Linux)
        33763 Win32 process ids can have more than 16 bits
        32809 Load 'loadable object' with non-default file extension
        32728 64-bit fix for Time::Local
  Built under MSWin32
  Compiled at Sep  3 2008 13:16:37
  @INC:
    c:/Perl/site/lib
    c:/Perl/lib
    .

> Yann
* What is your Template-Toolkit version?
* is it possible to attach 'data\template\template\en\default\list\list.csv.tmpl' file? (change en to the language in use)

Comment 8

8 years ago
Reproducable with Version 3.2 

When exporting the same buglist to CSV with Version 3.2.2, no errors occur.

Using on both machines ActivePerl 5.10 on Windows 2k3.

Comment 9

8 years ago
This has been reported by enough people (here and on the mailing list) that it's confirmed.
Assignee: query-and-buglist → mkanat
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking3.2.4+
Hardware: x86 → All
Target Milestone: --- → Bugzilla 3.2

Comment 10

8 years ago
I've pinged the Template Toolkit maintainer about the relevant TT bug ( https://rt.cpan.org/Public/Bug/Display.html?id=43345 ) again.

Comment 11

8 years ago
The TT bug has been resolved, and will be fixed in the next release. I'm not going to block release on this, because basically at this point we're just waiting on a new version of Template Toolkit, and I don't know when that's going to happen.
Flags: blocking3.2.4+ → blocking3.2.4-
(Assignee)

Comment 12

8 years ago
TT 2.21 has been released a few days ago, which includes this fix.
(Assignee)

Comment 13

8 years ago
Max, want to block 3.4rc1 on it now that TT 2.21 is available? Per our discussion on IRC, it's probably only required on Windows.
Flags: blocking3.4?

Updated

8 years ago
Flags: blocking3.4? → blocking3.4+

Comment 14

8 years ago
I'm not going to fix this bug until theoryx5 updates their repo to have the latest Template-Toolkit, which I believe LpSolit has asked them to do.
(Assignee)

Comment 15

8 years ago
Yeah, I asked Randy yesterday.
(Assignee)

Comment 16

8 years ago
FYI, TT 2.21 is not available on Windows because it doesn't pass its own tests. Andy Wardley, the maintainer of Template-Toolkit, said this problem was fixed in the development version 2.21_02. So we now have to wait for TT 2.22, it looks like.
(Assignee)

Comment 17

8 years ago
Created attachment 389184 [details] [diff] [review]
patch for 3.2 only, v1

This patch is for 3.2.5 only as 3.4 and HEAD will get the patch from bug 457524, which requires TT 2.22 on all platforms.
Assignee: mkanat → LpSolit
Status: NEW → ASSIGNED
Attachment #389184 - Flags: review?(mkanat)

Updated

8 years ago
Attachment #389184 - Flags: review?(mkanat) → review+

Updated

8 years ago
Flags: approval3.2+
(Assignee)

Comment 18

8 years ago
This patch will land on the 3.2 branch only, see comment 17.
Flags: blocking3.4-
Flags: blocking3.4+
Flags: blocking3.2.5+
(Assignee)

Comment 19

8 years ago
(In reply to comment #15)
> Yeah, I asked Randy yesterday.

He just replied to me right now. TT 2.21 is now available from theory58S.
(Assignee)

Comment 20

8 years ago
3.2.4:

Checking in Bugzilla/Install/Requirements.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm,v  <--  Requirements.pm
new revision: 1.47.2.9; previous revision: 1.47.2.8
done
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Updated

8 years ago
Duplicate of this bug: 515617
You need to log in before you can comment on or make changes to this bug.