If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

MIME::Parser mangles xml files

RESOLVED WORKSFORME

Status

()

Bugzilla
Bug Import/Export & Moving
RESOLVED WORKSFORME
12 years ago
12 years ago

People

(Reporter: Erik Hovland, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
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.
(Reporter)

Comment 1

12 years ago
Created attachment 218924 [details] [diff] [review]
skips MIME::Parser if a file is given at the command line

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.

Comment 2

12 years ago
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
Last Resolved: 12 years ago
Resolution: --- → WORKSFORME

Comment 3

12 years ago
(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.