Open Bug 884730 Opened 12 years ago Updated 12 years ago

Add an --exporter switch to importxml

Categories

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

enhancement
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: GeekShadow, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

Currently each bug you want to import needs to have an exporter="" field in xml. I ran a backup of bugs but I don't have this. So it would be nice to have a switch in importxml script to input the exporter.
Severity: normal → enhancement
OS: Windows XP → All
Hardware: x86 → All
Attached patch v1 - add the --exporter flag (obsolete) — Splinter Review
My patch work with --exporter=foo@bar.com but not --export foo@bar.com also it's my first time on Perl.
Attachment #764764 - Flags: review?(glob)
Attachment #764764 - Flags: review?(LpSolit)
Comment on attachment 764764 [details] [diff] [review] v1 - add the --exporter flag >+ if (!$exporter) { >+ $exporter = $default_exporter; >+ } Simply write: my $exporter = $root->{'att'}->{'exporter'} || $default_exporter; > my $exporter_login = $root->{'att'}->{'exporter'}; >+ >+ if ($default_exporter) { >+ $exporter_login = $default_exporter; >+ } Same here. You also forgot to set the exporter around line 1268 if none is specified in the XML file. Otherwise looks good. :)
Attachment #764764 - Flags: review?(glob)
Attachment #764764 - Flags: review?(LpSolit)
Attachment #764764 - Flags: review-
Attachment #764764 - Attachment is obsolete: true
Attachment #765233 - Flags: review?(LpSolit)
@Frédéric So what do you think ?
Comment on attachment 765233 [details] [diff] [review] v2 - add the --exporter flag >+ my $exporter_login = $root->{'att'}->{'exporter'}; || $default_exporter; The code doesn't compile due to the semi-colon before ||. Also, you must detaint $exporter_login in process_bug(), else importxml.pl crashes: Insecure dependency in parameter 5 of DBI::st=HASH(0xa677028)->execute method call while running with -T switch at ./importxml.pl line 1205. One way to do it is to set $exporter_login = $exporter->login. Do you want to upload a new patch with these problems fixed or do you want me to do it myself?
Attachment #765233 - Flags: review?(LpSolit) → review-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: