Closed Bug 334569 Opened 18 years ago Closed 18 years ago

MIME::Parser mangles xml files

Categories

(Bugzilla :: Bug Import/Export & Moving, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: erik, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1
Build Identifier: BUGZILLA-2_22-BRANCH

Let's say one just asked an old install of bugzilla to give one a list of all bugs. Then hit the 'XML' button. This will basically give an export of all of the bugs. If one saves that file using their favorite browser (firefox of course!). Then uses that file with importxml.pl, importxml.pl will promptly run that file through MIME::Parser. That will mangle the file and importxml.pl will tank after importing the first bug.

Reproducible: Always

Steps to Reproduce:
1. export bugs from database as xml file
2. import that bug using 'importxml.pl <filename>'
3. Note that it tanked.
This patch makes a small change to make sure that the xml input is not put through the MIME::Parser if the input was given as a file name at the command line instead  of piped in.

This fixed bug importing for me. But I have no idea if this is the correct way to solve the problem.
The block you changed is required in 2.22+. Moreover, moving bugs from 2.20.1 to 2.22rc1 works fine.

I one case, I had:

Subject: Moving bug(s) 64,67,68
To: LpSolit@gmail.com
From: Bugzilla <selenium@bugzilla.org>

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE bugzilla SYSTEM "http://localhost/bugzilla220/bugzilla.dtd">

<bugzilla version="2.20.1+"


In the other one, I had:

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE bugzilla SYSTEM "http://localhost/bugzilla220/bugzilla.dtd">

<bugzilla version="2.20.1+"


I could correctly import bugs in both cases.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
(In reply to comment #0)
> Let's say one just asked an old install of bugzilla to give one a list of all
> bugs. Then hit the 'XML' button. This will basically give an export of all of
> the bugs. If one saves that file using their favorite browser (firefox of
> course!). Then uses that file with importxml.pl, importxml.pl will promptly run
> that file through MIME::Parser. That will mangle the file and importxml.pl will
> tank after importing the first bug.

That is actually exactly how I usually do it and how I tested importxml.pl while reworking it. I have never had a problem with MIME::Parser doing anything to the xml whatsoever. If you can give an example of how it mangles the xml I would be interested in seeing it. 

But, I have tested moving bugs from all versions since 2.18 to 2.22 and 2.20.1 (modified with the new importxml) using the method you describe (saving xml from a bug list in firefox and running importxml from the command line) without any problems.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: