Closed Bug 292423 Opened 20 years ago Closed 20 years ago

[BUGZILLA] mozbot fails on "bug XXX" searches if the installation has disabled target_milestone

Categories

(Webtools Graveyard :: Mozbot, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mkanat, Assigned: mkanat)

Details

Attachments

(1 file)

I'm trying to set up a mozbot against bugzilla.redhat.com, which doesn't use the target_milestone field. When I say: "bug 1922" to mozbot, it dies with this: Can't call method "getData" on an undefined value at (eval 131) line 322, <GEN132> chunk 1. (That line number isn't totally accurate for CVS, because I have one or two debug lines in there, also.) This is with the CVS tip as of today. In the XML, I have: <target_milestone/> So getFirstChild is probably returning undef, and that's killing this. Should be an easy fix.
Status: NEW → ASSIGNED
OS: Linux → All
Target Milestone: --- → Mozbot 2.6
Attached patch FixSplinter Review
This fixes it, verified by me against bugzilla.redhat.com. (You can see the working bot, "cluebot" in #fedora or #fedora-devel on FreeNode.) I'd ask justdave for review, but... I'm not sure he'd ever have the time. :-)
Attachment #182243 - Flags: review?(ian)
Comment on attachment 182243 [details] [diff] [review] Fix ok, so we're not creating a %bug key for the field in it's null in the XML... so what happens when we try to reference it later? Is the later code using the %bug keys instead of the %fieldmap keys? If it's using %fieldmap, does it fail gracefully on a non-existing or undef key?
(In reply to comment #2) > (From update of attachment 182243 [details] [diff] [review] [edit]) >[snip] If it's using %fieldmap, does it fail gracefully on a non-existing or > undef key? The later code is using the %bug keys, so it just excludes that field from the printed list. It works quite nicely, actually. :-)
Attachment #182243 - Flags: review?(ian) → review?(colin.ogilvie)
Just a useless 'me too' comment that this worked beautifully for me as well.
Comment on attachment 182243 [details] [diff] [review] Fix Seems to work in my test cases (bugs on redhat and mozilla's bugzilla) You could do the following I guess, but that may make the line quite long ;) $bug{$fieldMap{$field}} = $firstChild->getData();
Attachment #182243 - Flags: review?(colin.ogilvie) → review+
Ahh, good point. :-) I made the change before I did the checkin. :-) Checking in Bugzilla.bm; /cvsroot/mozilla/webtools/mozbot/BotModules/Bugzilla.bm,v <-- Bugzilla.bm new revision: 2.13; previous revision: 2.12 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: kerz → mozbot
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: