summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Field.pm5
-rw-r--r--template/en/default/global/code-error.html.tmpl10
2 files changed, 12 insertions, 3 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index a2a08cd4b..077c67e20 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -837,6 +837,11 @@ sub run_create_validators {
$params->{visibility_field_id});
my $type = $params->{type} || 0;
+
+ if ($params->{custom} && !$type) {
+ ThrowCodeError('field_type_not_specified');
+ }
+
$params->{value_field_id} =
$class->_check_value_field_id($params->{value_field_id},
($type == FIELD_TYPE_SINGLE_SELECT
diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl
index 3c9f73f4c..64bd41af3 100644
--- a/template/en/default/global/code-error.html.tmpl
+++ b/template/en/default/global/code-error.html.tmpl
@@ -154,13 +154,17 @@
to generate the right class (you can't call class methods directly
on Bugzilla::Field::Choice).
+ [% ELSIF error == "field_not_custom" %]
+ '[% field.description FILTER html %]' ([% field.name FILTER html %])
+ is not a custom field.
+
[% ELSIF error == "field_type_mismatch" %]
Cannot seem to handle <code>[% field FILTER html %]</code>
and <code>[% type FILTER html %]</code> together.
- [% ELSIF error == "field_not_custom" %]
- '[% field.description FILTER html %]' ([% field.name FILTER html %])
- is not a custom field.
+ [% ELSIF error == "field_type_not_specified" %]
+ [% title = "Field Type Not Specified" %]
+ You must specify a type when creating a custom field.
[% ELSIF error == "illegal_content_type_method" %]
Your form submission got corrupted somehow. The <em>content