Closed
Bug 360626
Opened 18 years ago
Closed 15 years ago
ThrowTemplateError() used in Util.pm
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.4
People
(Reporter: LpSolit, Assigned: reed)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
While working on a patch, I reached ThrowTemplateError() in Util::get_text():
$template->process('global/message.txt.tmpl', $vars, \$message)
|| ThrowTemplateError($template->error());
But this routine isn't defined:
Undefined subroutine &Bugzilla::Util::ThrowTemplateError called at Bugzilla/Util.pm line 498.
Util.pm cannot |use Bugzilla::Error;| because Error.pm already uses Util.pm. I remember we moved all code throwing errors out of Util.pm. Maybe should we do the same with get_text() and move it into Template.pm. After all, get_text() is a template thing.
Comment 1•18 years ago
|
||
I seem to recall that get_text doesn't work inside Bugzilla::Template, for dependency reasons or something. I think I originally put it there, and I had some problem. Maybe not, though.
Reporter | ||
Updated•17 years ago
|
Assignee: general → LpSolit
Target Milestone: Bugzilla 3.0 → Bugzilla 3.2
Reporter | ||
Updated•17 years ago
|
Target Milestone: Bugzilla 3.2 → ---
Comment 3•17 years ago
|
||
Confirmed for 3.02. It seems as if this also inhibits the presentation of non-english localisation email templates: If "defaultlanguage" is set to the default "en" and "languages" to a different locale ("de"), mails are still sent in "en" although translated templates are present in ../de/default/email/. Wouldn`t it make more sense to connect the mail template language to the default "languages" instead (unless users have individual settings) ?
Comment 4•17 years ago
|
||
(In reply to comment #3)
> It seems as if this also inhibits the presentation of
> non-english localisation email templates:
No, that would be unrelated to this bug.
Reporter | ||
Updated•16 years ago
|
Assignee: LpSolit → general
Assignee | ||
Updated•15 years ago
|
Summary: ThrowTemplateError() used in Util.pm → ThrowTemplateError() and ThrowUserError() used in Util.pm
Assignee | ||
Comment 6•15 years ago
|
||
ThrowUserError() is used in SqlifyDate() inside of Util.pm... Thoughts?
Comment 7•15 years ago
|
||
require Bugzilla::Error inside the relevant subroutines.
Assignee | ||
Updated•15 years ago
|
Summary: ThrowTemplateError() and ThrowUserError() used in Util.pm → ThrowTemplateError() used in Util.pm
Reporter | ||
Updated•15 years ago
|
Attachment #412738 -
Flags: review?(LpSolit) → review-
Reporter | ||
Comment 9•15 years ago
|
||
Comment on attachment 412738 [details] [diff] [review]
patch - v1
>+ require Bugzilla::Error;
> $template->process('global/message.txt.tmpl', $vars, \$message)
> || ThrowTemplateError($template->error());
|require| doesn't automatically import ThrowTemplateError(). You have to use the full "path" Bugzilla::Error::ThrowTemplateError. Now, as this error isn't going to happen very often, I wonder if it's a good idea to waste cycle require'ing Bugzilla::Error everytime get_text() is called. I think something like this would be better:
if (!$template->...) {
require Bugzilla::Error;
Bugzilla::Error::ThrowTemplateError()
}
Assignee | ||
Comment 10•15 years ago
|
||
Neat.
Assignee: general → reed
Attachment #412738 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #413106 -
Flags: review?(LpSolit)
Reporter | ||
Updated•15 years ago
|
Attachment #413106 -
Flags: review?(LpSolit) → review+
Reporter | ||
Updated•15 years ago
|
Severity: normal → minor
Flags: approval3.4+
Flags: approval+
Target Milestone: --- → Bugzilla 3.4
Assignee | ||
Comment 11•15 years ago
|
||
tip:
Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v <-- Util.pm
new revision: 1.97; previous revision: 1.96
done
BUGZILLA-3_4-BRANCH:
Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v <-- Util.pm
new revision: 1.86.2.4; previous revision: 1.86.2.3
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 12•15 years ago
|
||
By the way, "require" is very fast it doesn't have to load the module--it's just checking %INC, which is just a hash-key check.
You need to log in
before you can comment on or make changes to this bug.
Description
•