Bug 454238 - bugzilla.getBug and Bug.get don't work as expected
bugzilla.getBug and Bug.get don't work as expected
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: WebService (Show other bugs)
3.2
All Linux
low Severity low (vote)
: ---
: ---
Assigned To: Noura El hawary
:
Depends On:
Blocks: RHBZ30UpgradeTracker
  Show dependency treegraph
 
Reported: 2008-07-07 02:25 EDT by Noura El hawary
Modified: 2013-06-24 00:10 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-22 16:11:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Noura El hawary 2008-07-07 02:25:10 EDT
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 01:33:41 EDT
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 14:03:57 EDT
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 05:53:41 EDT
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 11:44:30 EDT
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 17:31:31 EDT
Thanks for the review Dave, all committed to cvs now.
Comment 6 David Lawrence 2008-07-22 16:11:17 EDT
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.