Closed Bug 439075 Opened 16 years ago Closed 16 years ago

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

Categories

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

3.1.4
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

(Keywords: regression)

Attachments

(1 file)

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+
OK, I regressed it in bug 417030, so I will fix it myself.
Assignee: import-export → LpSolit
Depends on: 417030
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
Attached patch patch, v1Splinter Review
Make sure all checks about multi-select fields always have an array in hands.
Attachment #325030 - Flags: review?(ghendricks)
Comment on attachment 325030 [details] [diff] [review]
patch, v1

I like it. Simple, easy to remember.
Attachment #325030 - Flags: review?(ghendricks) → review+
Flags: approval3.2+
Flags: approval+
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
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: