Bug 454238 - bugzilla.getBug and Bug.get don't work as expected
Summary: bugzilla.getBug and Bug.get don't work as expected
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: WebService
Version: 3.2
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Noura El hawary
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: RHBZ30UpgradeTracker
TreeView+ depends on / blocked
 
Reported: 2008-07-07 06:25 UTC by Noura El hawary
Modified: 2013-06-24 04:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-22 20:11:17 UTC
Embargoed:


Attachments (Terms of Use)
v1 fix for functions bugzilla.getBug and Bug.get (5.72 KB, patch)
2008-07-08 05:33 UTC, Noura El hawary
dkl: review-
Details | Diff
v2 fix functions bugzilla.getBug and Bug.get (5.72 KB, patch)
2008-07-09 09:53 UTC, Noura El hawary
dkl: review+
Details | Diff

Description Noura El hawary 2008-07-07 06:25:10 UTC
running the selenium/xmlrpc testsuite getBug and getBugSimple do not work as
expected, they don't return the right output.

Comment 1 Noura El hawary 2008-07-08 05:33:41 UTC
Created attachment 311227 [details]
v1 fix for functions bugzilla.getBug and Bug.get

Basically the function getBugSimple is fine ,, the problem was in
bugzilla.getBug and Bug.get,, the problem was coming from the external bugzilla
extension , as the extension was adding external_bugs object to the actual bug
object as the following:
'external_bugs' => bless( {
			   '_bug_obj' => $VAR1->{'log'},
			   'bugs' => [
				      {
					'is_bz' => undef,
					'url' => 'http://gmome.bugzilla.org',
					'bug_id' => '256',
					'id' => '2',
					'description' => 'kde blah',
					'full_url' => undef
				       }
				    ]
			}, 'extensions::external_bugs::lib::ExternalBugs' ),


and this failing the bug object to be returned in xml, looking in 2.18 in
bugzilla.getBug we only return what is in {external_bugs}{bugs} from the above
so i filtered that in the bug object and it was working fine after. 

the attached patch include:

1- fix for Bug.get as described above.

2- fix for bugzilla.getBug includes the above + returns all missing bug object
info + deleting custom filed names with cf_* as we return it without the cf_*

3- deleted the get_activity function and its pod as it is replaced with
get_history now.

Please review when you can.

Noura

Comment 2 David Lawrence 2008-07-08 18:03:57 UTC
Comment on attachment 311227 [details]
v1 fix for functions bugzilla.getBug and Bug.get

>Index: Bugzilla/WebService/Bug.pm
>===================================================================
>+        $bug->{external_bugs} = $bug->{external_bugs}{bugs};

Please do not access the object as hash unless necessary. So instead do:

	$bug->{external_bugs} = $bug->external_bugs->{bugs};

The fields() sub in Bug.pm should add external_bugs as a valid class accessor
so the above should work.

>Index: extensions/compat_xmlrpc/code/webservice.pl
>===================================================================

>+    $bug->{external_bugs} = $bug->{external_bugs}{bugs};

Same as above.

Comment 3 Noura El hawary 2008-07-09 09:53:41 UTC
Created attachment 311358 [details]
v2 fix functions bugzilla.getBug and Bug.get

Thanks for the review Dave , here is another patch with the fix

Noura

Comment 4 David Lawrence 2008-07-09 15:44:30 UTC
Comment on attachment 311358 [details]
v2 fix functions bugzilla.getBug and Bug.get

Looks good Noura. Assuming it tests ok then feel free to commit.

Dave

Comment 5 Noura El hawary 2008-07-09 21:31:31 UTC
Thanks for the review Dave, all committed to cvs now.

Comment 6 David Lawrence 2008-07-22 20:11:17 UTC
The changes have been pushed to partner-bugzilla.redhat.com and/or have been
recorded in the Bugzilla migration pages on the Bugzilla 3 upgrade Wiki.

Closing as NEXTRELEASE.
Dave


Note You need to log in before you can comment on or make changes to this bug.