Closed
Bug 237591
Opened 20 years ago
Closed 20 years ago
Regexp metachars in product names break importxml.pl
Categories
(Bugzilla :: Bug Import/Export & Moving, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.16
People
(Reporter: Richard.Giraud, Assigned: justdave)
Details
(Whiteboard: [fixed in 2.16.6] [does not affect trunk])
Attachments
(4 files)
User-Agent: Opera/7.23 (Windows NT 5.0; U) [en] Build Identifier: importxml.pl does not properly import bugs. Instead, it gives the following message: Bug import error: invalid default product or component Reproducible: Always Steps to Reproduce: 1. Create XML representation of a bug via xml.cgi 2. Save to disk. 3. Run importxml.pl on file (e.g., sudo perl importxml.pl bug.xml). Actual Results: Import stopped during first bug with following message. Bug import error: invalid default product or component Expected Results: Imported the bug. Around line 380 or so, importxml.pl filters the arrays of products and components using the grep command. An examination reveals that grep filters out all elements in the array. The product name is correctly determined a few lines earlier and a comparison of the product name to the first element of the @::legal_product array returns a value of 1. Similar problems occur with the component checking. The version of PERL being used is v5.8.1-RC3. I will include example code shortly (it is on a different box).
Assignee | ||
Comment 1•20 years ago
|
||
What version of Bugzilla? There is no "grep" in use in the current version leading up to the mentioned error message. It's just calling get_product_id() on it and giving the error if that fails.
Reporter | ||
Comment 2•20 years ago
|
||
Reporter | ||
Comment 3•20 years ago
|
||
This is the minimal dataset that I have tested that causes the problem.
Assignee | ||
Comment 4•20 years ago
|
||
OK, found the code in question in 2.16.5. Someone wrote some really sloppy grep code there. No quoting of the variables, and your product names have regexp metachars in them. Adding \Q and \E around the variable names will probably fix it, but doing { lc($_) eq lc($product_name) } in place of the regexp would probably be a much better fix.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: MacOS X → All
Hardware: Macintosh → All
Summary: can not import data via importxml.pl; problem with filtering arrays via grep. → Regexp metachars in product names break importxml.pl
Whiteboard: [wanted for 2.16.6] [does not affect trunk]
Target Milestone: --- → Bugzilla 2.16
Version: unspecified → 2.16.5
Reporter | ||
Comment 5•20 years ago
|
||
I have added some print statements to display the internal state of the script at the appropriate points.
Assignee | ||
Comment 6•20 years ago
|
||
Give this patch a shot and let me know if this fixes it.
Assignee | ||
Updated•20 years ago
|
Attachment #143999 -
Flags: review?(bbaetz)
Assignee | ||
Updated•20 years ago
|
Attachment #143999 -
Flags: review?(guzman)
Reporter | ||
Comment 7•20 years ago
|
||
That solved the problem. Thank you very much :)
Updated•20 years ago
|
Attachment #143999 -
Flags: review?(bbaetz) → review+
Assignee | ||
Updated•20 years ago
|
Flags: blocking2.16.6+
Assignee | ||
Comment 8•20 years ago
|
||
Checking in importxml.pl; /cvsroot/mozilla/webtools/bugzilla/importxml.pl,v <-- importxml.pl new revision: 1.23.2.3; previous revision: 1.23.2.2 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Flags: approval2.16+
Resolution: --- → FIXED
Whiteboard: [wanted for 2.16.6] [does not affect trunk] → [fixed in 2.16.6] [does not affect trunk]
Comment 9•20 years ago
|
||
Comment on attachment 143999 [details] [diff] [review] Patch v1 Removing r? from FIXED bug.
Attachment #143999 -
Flags: review?(guzman)
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•