Closed Bug 304642 Opened 19 years ago Closed 19 years ago

Bugzilla::Flag::GetTarget() should be called internally by Bugzilla::Flag::process()

Categories

(Bugzilla :: Attachments & Requests, enhancement)

2.21
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

Attachments

(1 file)

attachment.cgi:
line 1057:
  my $target = Bugzilla::Flag::GetTarget(undef, $attachid);
  Bugzilla::Flag::process($target, $timestamp, $cgi);

line 1206:
  my $target = Bugzilla::Flag::GetTarget(undef, $attach_id);
  Bugzilla::Flag::process($target, $timestamp, $cgi);


process_bug.cgi:
line 1738:
    my $target = Bugzilla::Flag::GetTarget($id);
    Bugzilla::Flag::process($target, $timestamp, $cgi);

process() should call GetTarget() itself. Its params are then:
Bugzilla::Flag::process($bug_id, $attach_id, $timestamp, $cgi);

I will also rename GetTarget() as get_target().

Note that with this change, get_target() will only be called from Flag.pm.
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.22
Attached patch patch, v1Splinter Review
I added a trivial test into process() to make sure the target object exists.
The remaining validations have been made by Bugzilla::Flag::validate().
Attachment #192686 - Flags: review?(myk)
Comment on attachment 192686 [details] [diff] [review]
patch, v1

looks good; r=myk
Attachment #192686 - Flags: review?(myk) → review+
Flags: approval?
Flags: approval? → approval+
Checking in attachment.cgi;
/cvsroot/mozilla/webtools/bugzilla/attachment.cgi,v  <--  attachment.cgi
new revision: 1.92; previous revision: 1.91
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.277; previous revision: 1.276
done
Checking in Bugzilla/Flag.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v  <--  Flag.pm
new revision: 1.48; previous revision: 1.47
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: