summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2006-03-01 00:41:04 +0100
committerjocuri%softhome.net <>2006-03-01 00:41:04 +0100
commit4cde47cdf30a0f3f97c782e8b13cde0149851143 (patch)
treeb7d3903b838aa9d9ea20df6eb144ea6c93329ed9
parent692dcb72ed5ed25d2320a962ab28008a797c5b08 (diff)
downloadbugzilla-4cde47cdf30a0f3f97c782e8b13cde0149851143.tar.gz
bugzilla-4cde47cdf30a0f3f97c782e8b13cde0149851143.tar.xz
Fix ThrowCodeError calls by giving them an unique ID (tree fix).
-rw-r--r--Bugzilla/Hook.pm4
-rw-r--r--Bugzilla/Template/Plugin/Hook.pm2
-rw-r--r--template/en/default/global/code-error.html.tmpl7
3 files changed, 10 insertions, 3 deletions
diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm
index 97bec6c5c..9d8059478 100644
--- a/Bugzilla/Hook.pm
+++ b/Bugzilla/Hook.pm
@@ -43,8 +43,8 @@ sub process {
trick_taint($extension);
if (-e $extension.'/code/'.$name.'.pl') {
do($extension.'/code/'.$name.'.pl');
- ThrowCodeError("An error occured processing hook \"$name\" in ".
- "Bugzilla extension \"$extension\": $@") if $@;
+ ThrowCodeError('extension_invalid', {
+ name => $name, extension => $extension }) if $@;
}
}
diff --git a/Bugzilla/Template/Plugin/Hook.pm b/Bugzilla/Template/Plugin/Hook.pm
index 2f94c1dbe..7ff707fc1 100644
--- a/Bugzilla/Template/Plugin/Hook.pm
+++ b/Bugzilla/Template/Plugin/Hook.pm
@@ -52,7 +52,7 @@ sub process {
# sanity check:
if (!$template =~ /[\w\.\/\-_\\]+/) {
- ThrowCodeError("Template with invalid file name found in hook call: $template");
+ ThrowCodeError('template_invalid', { name => $template});
}
# also get extension hook files that live in extensions/:
diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl
index a0e4e3a9a..d9220f27b 100644
--- a/template/en/default/global/code-error.html.tmpl
+++ b/template/en/default/global/code-error.html.tmpl
@@ -103,6 +103,10 @@
[% ELSIF error == "cookies_need_value" %]
Every cookie must have a value.
+ [% ELSIF error == "extension_invalid" %]
+ An error occured processing hook [% name FILTER html %] in
+ extension [% extension FILTER html %].
+
[% ELSIF error == "field_type_mismatch" %]
Cannot seem to handle <code>[% field FILTER html %]</code>
and <code>[% type FILTER html %]</code> together.
@@ -292,6 +296,9 @@
[% ELSIF error == "template_error" %]
[% template_error_msg FILTER html %]
+ [% ELSIF error == "template_invalid" %]
+ Template with invalid file name found in hook call: [% name FILTER html %].
+
[% ELSIF error == "unable_to_retrieve_password" %]
I was unable to retrieve your old password from the database.