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

RESOLVED FIXED in Bugzilla 3.2



11 years ago
10 years ago


(Reporter: ycombarnous, Assigned: LpSolit)


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



(1 attachment)



11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 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
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.


11 years ago
Version: unspecified → 3.2

Comment 1

11 years ago
Not sure if this is related to bug 467920
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

11 years ago
Bug 464992 comment 41: related bug can be remedied by upgrading Perl to 5.10.0.

Comment 4

11 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

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

> 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

10 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.
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
Ever confirmed: true
Flags: blocking3.2.4+
Hardware: x86 → All
Target Milestone: --- → Bugzilla 3.2
I've pinged the Template Toolkit maintainer about the relevant TT bug ( https://rt.cpan.org/Public/Bug/Display.html?id=43345 ) again.
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-

Comment 12

10 years ago
TT 2.21 has been released a few days ago, which includes this fix.

Comment 13

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


10 years ago
Flags: blocking3.4? → blocking3.4+
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.

Comment 15

10 years ago
Yeah, I asked Randy yesterday.

Comment 16

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

Comment 17

10 years ago
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
Attachment #389184 - Flags: review?(mkanat)


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


10 years ago
Flags: approval3.2+

Comment 18

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

Comment 19

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

Comment 20

10 years ago

Checking in Bugzilla/Install/Requirements.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm,v  <--  Requirements.pm
new revision:; previous revision:
Closed: 10 years ago
Resolution: --- → FIXED


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