Importing bugs which have a multi-select field with a single value fail

RESOLVED FIXED in Bugzilla 3.2

Status

()

--
major
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: LpSolit, Assigned: LpSolit)

Tracking

({regression})

3.1.4
Bugzilla 3.2
regression
Bug Flags:
approval +
approval3.2 +
blocking3.2 +

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
I tried to import a bug from a 2.23.3 installation into a 3.1.4 one. Bugs which have no dependency or several ones are imported without any problem. Those having a single dependency cannot be imported and the following error is thrown:

Can't use string ("1020") as an ARRAY ref while "strict refs" in use at ./importxml.pl line 568, <> chunk 1.


The problem comes from:

    if ( defined $bug_fields{'dependson'} ) {
        $comments .= "This bug depended on bug(s) " .
                     join(' ', @{$bug_fields{'dependson'}}) . ".\n";

If there is a single <dependson>1020</dependson> in the XML file, it's not seen as an array and @{...} fails.

I cannot reproduce the problem when importing into Bugzilla 3.0.4, so this regression is pretty new. We should fix it before releasing 3.2 RC1.
Flags: blocking3.2+
(Assignee)

Comment 1

10 years ago
OK, I regressed it in bug 417030, so I will fix it myself.
Assignee: import-export → LpSolit
Depends on: 417030
(Assignee)

Comment 2

10 years ago
As discussed with ghendricks on IRC, this affects any multi-select field which has only one value selected, including custom multi-select fields, the dependency fields (dependson and blocked) and the CC list. In all other cases, this should be fine.
Status: NEW → ASSIGNED
Summary: Importing bugs which have only one dependency fail → Importing bugs which have a multi-select field with a single value fail
(Assignee)

Comment 3

10 years ago
Created attachment 325030 [details] [diff] [review]
patch, v1

Make sure all checks about multi-select fields always have an array in hands.
Attachment #325030 - Flags: review?(ghendricks)

Comment 4

10 years ago
Comment on attachment 325030 [details] [diff] [review]
patch, v1

I like it. Simple, easy to remember.
Attachment #325030 - Flags: review?(ghendricks) → review+
(Assignee)

Updated

10 years ago
Flags: approval3.2+
Flags: approval+
(Assignee)

Comment 5

10 years ago
tip:

Checking in importxml.pl;
/cvsroot/mozilla/webtools/bugzilla/importxml.pl,v  <--  importxml.pl
new revision: 1.84; previous revision: 1.83
done

3.1.4:

Checking in importxml.pl;
/cvsroot/mozilla/webtools/bugzilla/importxml.pl,v  <--  importxml.pl
new revision: 1.82.2.2; previous revision: 1.82.2.1
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.