Closed Bug 304660 Opened 19 years ago Closed 19 years ago

PerformSubsts should be in Util.pm instead of BugMail.pm

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.21
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

Attachments

(1 file)

(23:02:00) LpSolit: hum... showdependencygraph.cgi uses BugMail.pm but doesn't
send any email
(23:02:13) LpSolit: it only uses PerformSubsts()
(23:02:25) LpSolit: maybe this routine should really go into Util.pm
(23:08:39) justdave: LpSolit: yeah, definitely

The reason for this change is that you may want to do substitution without
sending any email, as in showdependencygraph.cgi. Another reason for this change
is that Bug.pm should not use BugMail.pm, see Bugzilla::Bug::RemoveVotes().

For the record, bug 277623 was the bug which initially moved PerformSubsts()
into BugMail.pm.
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.22
Attached patch patch, v1Splinter Review
this patch assumes bug 304653 has been checked in already.
Attachment #192705 - Flags: review?(mkanat)
Comment on attachment 192705 [details] [diff] [review]
patch, v1

Looks good and works on landfill.
Attachment #192705 - Flags: review?(mkanat) → review+
Flags: approval?
Ok, but it doesn't look like PerformSubsts should be a function at all, given
that it factors out only one line of code:

s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg;

This could much more simply (and readably) be inlined into the routines that
currently call the function.
Flags: approval? → approval+
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.334; previous revision: 1.333
done
Checking in showdependencygraph.cgi;
/cvsroot/mozilla/webtools/bugzilla/showdependencygraph.cgi,v  <-- 
showdependencygraph.cgi
new revision: 1.42; previous revision: 1.41
done
Checking in whineatnews.pl;
/cvsroot/mozilla/webtools/bugzilla/whineatnews.pl,v  <--  whineatnews.pl
new revision: 1.20; previous revision: 1.19
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.90; previous revision: 1.89
done
Checking in Bugzilla/BugMail.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v  <--  BugMail.pm
new revision: 1.49; previous revision: 1.48
done
Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v  <--  Util.pm
new revision: 1.39; previous revision: 1.38
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: