Closed
Bug 327914
Opened 18 years ago
Closed 17 years ago
Make Bugzilla::Util::perform_substs() go away
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.2
People
(Reporter: Wurblzap, Assigned: LpSolit)
References
Details
Attachments
(1 file)
3.18 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
When creating e-mails from their template params, variable substitution crashes badly if the variable to be substituted is neither a pre-defined variable nor a Bugzilla param, saying that an internal error occurred in Bugzilla::Config::Param. This may be all right for calls to Bugzilla::Config::Param() from "normal" code, but it is misleading for e-mail template params. For e-mail template params, the real cause will usually be a typo in the param's text (or similar error). The reason is that Bugzilla::Util::perform_substs calls Bugzilla::Config::Param without validating the substitution variable names, *and* Bugzilla::Config::Param die()s if the param name it's passed doesn't exist. Suggestion: Firstly, add an optional second param to Bugzilla::Config::Param, which, when defined, causes it not to die() but return undef when it can't find a param. Secondly, make Bugzilla::Util::perform_substs use the new optional second param, and fall back to the original variable substitution string if param substitution fails. In 2.18 and 2.20, the sub is called PerformSubsts and lives in Bugzilla::BugMail.
Reporter | ||
Updated•18 years ago
|
Whiteboard: [Good intro bug]
Reporter | ||
Updated•18 years ago
|
Summary: Bugzilla::Util::perform_substs error message needs to be more helpful → Bugzilla::Util::perform_substs error message not helpful
Reporter | ||
Comment 1•18 years ago
|
||
This is a FAQ which I think should be gone with 3.0.
Flags: blocking3.0?
Assignee | ||
Comment 2•18 years ago
|
||
perform_substs() is no longer used by email templates. The single place where it is still used is showdependencygraph.cgi. So I don't see how this could be a blocker, especially now that Param() has been replaced by Bugzilla->params->{} which never fails.
Assignee | ||
Comment 3•18 years ago
|
||
Unless I miss something, perform_substs() can go away. It's only used here: my $webdotbase = Bugzilla->params->{'webdotbase'}; if ($webdotbase =~ /^https?:/) { # Remote dot server my $url = perform_substs($webdotbase) . $filename; We should write: my $url = Bugzilla->params->{'webdotbase'} . $filename;
Comment 4•18 years ago
|
||
(In reply to comment #3) > Unless I miss something, perform_substs() can go away. It's only used here: > > We should write: > > my $url = Bugzilla->params->{'webdotbase'} . $filename; You have to replace the %urlbase% in the default webdotbase. But yes, other than that, we can remove perform_substs.
Reporter | ||
Comment 5•18 years ago
|
||
Cool! Not a blocker then. Should we morph this bug into "make perform_substs go away" or something?
Flags: blocking3.0?
Assignee | ||
Comment 6•18 years ago
|
||
(In reply to comment #5) > Should we morph this bug into "make perform_substs go > away" or something? Yes!
Reporter | ||
Updated•18 years ago
|
Summary: Bugzilla::Util::perform_substs error message not helpful → Make perform_substs go away
Assignee | ||
Comment 7•18 years ago
|
||
This bug is retargetted to Bugzilla 3.2 for one of the following reasons: - it has no assignee (except the default one) - we don't expect someone to fix it in the next two weeks (i.e. before we freeze the trunk to prepare Bugzilla 3.0 RC1) - it's not a blocker If you are working on this bug and you think you will be able to submit a patch in the next two weeks, retarget this bug to 3.0. If this bug is something you would like to see implemented in 3.0 but you are not a developer or you don't think you will be able to fix this bug yourself in the next two weeks, please *do not* retarget this bug. If you think this bug should absolutely be fixed before we release 3.0, either ask on IRC or use the "blocking3.0 flag".
Target Milestone: Bugzilla 3.0 → Bugzilla 3.2
Assignee | ||
Comment 8•17 years ago
|
||
Assignee: email-notifications → LpSolit
Status: NEW → ASSIGNED
Attachment #272487 -
Flags: review?(mkanat)
Comment 9•17 years ago
|
||
Comment on attachment 272487 [details] [diff] [review] patch, v1 r=mkanat by inspection
Attachment #272487 -
Flags: review?(mkanat) → review+
Updated•17 years ago
|
Flags: approval+
Assignee | ||
Comment 10•17 years ago
|
||
Checking in showdependencygraph.cgi; /cvsroot/mozilla/webtools/bugzilla/showdependencygraph.cgi,v <-- showdependencygraph.cgi new revision: 1.60; previous revision: 1.59 done Checking in Bugzilla/Util.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v <-- Util.pm new revision: 1.58; previous revision: 1.57 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Component: Email Notifications → Bugzilla-General
Resolution: --- → FIXED
Summary: Make perform_substs go away → Make Bugzilla::Util::perform_substs() go away
Whiteboard: [Good intro bug]
You need to log in
before you can comment on or make changes to this bug.
Description
•