bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Add an --exporter switch to importxml

UNCONFIRMED
Unassigned

Status

()

Bugzilla
Bug Import/Export & Moving
--
enhancement
UNCONFIRMED
5 years ago
5 years ago

People

(Reporter: GeekShadow, Unassigned)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
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.

Updated

5 years ago
Severity: normal → enhancement
OS: Windows XP → All
Hardware: x86 → All
(Reporter)

Comment 1

5 years ago
Created attachment 764764 [details] [diff] [review]
v1 - add the --exporter flag

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 2

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

Comment 3

5 years ago
Created attachment 765233 [details] [diff] [review]
v2 - add the --exporter flag
Attachment #764764 - Attachment is obsolete: true
Attachment #765233 - Flags: review?(LpSolit)
(Reporter)

Comment 4

5 years ago
@Frédéric
So what do you think ?

Comment 5

5 years ago
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.