Bug 525473

Summary: ValidateBugID function exists in some places of the branches/upstream3.4 code
Product: [Community] Bugzilla Reporter: Noura El hawary <nelhawar>
Component: Bugzilla GeneralAssignee: David Lawrence <dkl>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.4   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-28 18:33:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 514793    
Attachments:
Description Flags
Patch to remove ValidateBugID from remaining places (v1) nelhawar: review+

Description Noura El hawary 2009-09-24 14:12:27 UTC
Upstream has replaced the function ValidateBugID in 3.4 with Bugzilla::Bug->check, our merged code in branches/upstream3.4 code still has some places where it is calling the no longer existing function ValidateBugID, this needs to be changed.

[root@localhost upstream-3.4]# grep -rl ValidateBugID .
./show_comment_activity.cgi
./extensions/issuetracker/code/webservice.pl
./extensions/compat_xmlrpc/code/webservice.pl
./Bugzilla/WebService/Bug.pm

upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=440609

Noura

Comment 1 David Lawrence 2009-09-24 20:30:15 UTC
Created attachment 362566 [details]
Patch to remove ValidateBugID from remaining places (v1)

Patch to remove remaining ValidateBugID calls and convert to Bugzilla::Bug->check().

Please review

Dave

Comment 2 Noura El hawary 2009-09-28 12:10:23 UTC
Comment on attachment 362566 [details]
Patch to remove ValidateBugID from remaining places (v1)

Hey Dave,

Patch looks good to me, and working fine just couple of little changes needed as below "removing the new word":


>Index: extensions/issuetracker/code/webservice.pl
>===================================================================
>--- extensions/issuetracker/code/webservice.pl	(revision 1511)
>+++ extensions/issuetracker/code/webservice.pl	(working copy)
>@@ -55,8 +55,7 @@
>     $it_id  || ThrowCodeError( 'param_required', { param => 'issue' } );
>     $bug_id || ThrowCodeError( 'param_required', { param => 'id' } );
> 
>-    ValidateBugID($bug_id);
>-    my $bug = new Bugzilla::Bug($bug_id);
>+    my $bug = new Bugzilla::Bug->check($bug_id);

my $bug = Bugzilla::Bug->check($bug_id);


> 
>     # we have to check if the user can edit the bug the product
>     # is currently in, before we allow them to change anything.
>@@ -104,8 +103,7 @@
>     $it_id || ThrowCodeError( 'param_required', { param => 'issue' } );
>     $bug_id || ThrowCodeError( 'param_required', { param => 'id' } );
> 
>-    ValidateBugID($bug_id);
>-    my $bug = new Bugzilla::Bug($bug_id);
>+    my $bug = new Bugzilla::Bug->check($bug_id);

my $bug = Bugzilla::Bug->check($bug_id);
> 

I am also running the webservices tests currently and will see if more errors will occur. but as far as what this bug is about no more ValidatBugID exists in the code after applying the patch.

Thanks,
Noura

Comment 3 David Lawrence 2009-09-28 18:33:29 UTC
Thanks Noura. I fixed the issues you pointed out and checked in. Let me know how the testing goes. I am closing this and we can open a new bug if the testing finds any issues.