summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Bug.pm20
-rw-r--r--Bugzilla/DB/Oracle.pm4
-rw-r--r--Bugzilla/Field/ChoiceInterface.pm1
-rw-r--r--Bugzilla/User.pm5
-rwxr-xr-xquery.cgi7
-rw-r--r--template/en/default/search/search-report-select.html.tmpl7
6 files changed, 19 insertions, 25 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index a873d63be..08c347abe 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -745,6 +745,17 @@ sub run_create_validators {
my $class = shift;
my $params = $class->SUPER::run_create_validators(@_);
+ # Add classification for checking mandatory fields which depend on it
+ $params->{classification} = $params->{product}->classification->name;
+
+ my @mandatory_fields = @{ Bugzilla->fields({ is_mandatory => 1,
+ enter_bug => 1,
+ obsolete => 0 }) };
+ foreach my $field (@mandatory_fields) {
+ $class->_check_field_is_mandatory($params->{$field->name}, $field,
+ $params);
+ }
+
my $product = delete $params->{product};
$params->{product_id} = $product->id;
my $component = delete $params->{component};
@@ -769,18 +780,11 @@ sub run_create_validators {
delete $params->{resolution};
delete $params->{lastdiffed};
delete $params->{bug_id};
+ delete $params->{classification};
Bugzilla::Hook::process('bug_end_of_create_validators',
{ params => $params });
- my @mandatory_fields = @{ Bugzilla->fields({ is_mandatory => 1,
- enter_bug => 1,
- obsolete => 0 }) };
- foreach my $field (@mandatory_fields) {
- $class->_check_field_is_mandatory($params->{$field->name}, $field,
- $params);
- }
-
return $params;
}
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 7df2c09bb..644276898 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -550,7 +550,9 @@ sub bz_setup_database {
. " RETURN NUMBER IS BEGIN RETURN LENGTH(COLUMN_NAME); END;");
# Create types for group_concat
- $self->do("DROP TYPE T_GROUP_CONCAT");
+ my $type_exists = $self->selectrow_array("SELECT 1 FROM user_types
+ WHERE type_name = 'T_GROUP_CONCAT'");
+ $self->do("DROP TYPE T_GROUP_CONCAT") if $type_exists;
$self->do("CREATE OR REPLACE TYPE T_CLOB_DELIM AS OBJECT "
. "( p_CONTENT CLOB, p_DELIMITER VARCHAR2(256)"
. ", MAP MEMBER FUNCTION T_CLOB_DELIM_ToVarchar return VARCHAR2"
diff --git a/Bugzilla/Field/ChoiceInterface.pm b/Bugzilla/Field/ChoiceInterface.pm
index 87354a103..3292536d3 100644
--- a/Bugzilla/Field/ChoiceInterface.pm
+++ b/Bugzilla/Field/ChoiceInterface.pm
@@ -183,6 +183,7 @@ sub is_set_on_bug {
# This allows bug/create/create.html.tmpl to pass in a hashref that
# looks like a bug object.
my $value = blessed($bug) ? $bug->$field_name : $bug->{$field_name};
+ $value = $value->name if blessed($value);
return 0 if !defined $value;
if ($self->field->type == FIELD_TYPE_BUG_URLS
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 2c11c2381..bd7c8123b 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -2493,7 +2493,8 @@ the database again. Used mostly by L<Bugzilla::Product>.
=item C<can_enter_product($product_name, $warn)>
- Description: Returns 1 if the user can enter bugs into the specified product.
+ Description: Returns a product object if the user can enter bugs into the
+ specified product.
If the user cannot enter bugs into the product, the behavior of
this method depends on the value of $warn:
- if $warn is false (or not given), a 'false' value is returned;
@@ -2504,7 +2505,7 @@ the database again. Used mostly by L<Bugzilla::Product>.
must be thrown if the user cannot enter bugs
into the specified product.
- Returns: 1 if the user can enter bugs into the product,
+ Returns: A product object if the user can enter bugs into the product,
0 if the user cannot enter bugs into the product and if $warn
is false (an error is thrown if $warn is true).
diff --git a/query.cgi b/query.cgi
index bfb79e52c..26c26049d 100755
--- a/query.cgi
+++ b/query.cgi
@@ -248,13 +248,6 @@ if (($cgi->param('query_format') || $cgi->param('format') || "")
$vars->{'category'} = Bugzilla::Chart::getVisibleSeries();
}
-if ($cgi->param('format') && $cgi->param('format') =~ /^report-(table|graph)$/) {
- # Get legal custom fields for tabular and graphical reports.
- my @custom_fields_for_reports =
- grep { $_->type == FIELD_TYPE_SINGLE_SELECT } Bugzilla->active_custom_fields;
- $vars->{'custom_fields'} = \@custom_fields_for_reports;
-}
-
$vars->{'known_name'} = $cgi->param('known_name');
$vars->{'columnlist'} = $cgi->param('columnlist');
diff --git a/template/en/default/search/search-report-select.html.tmpl b/template/en/default/search/search-report-select.html.tmpl
index 5e5db06e2..44425898a 100644
--- a/template/en/default/search/search-report-select.html.tmpl
+++ b/template/en/default/search/search-report-select.html.tmpl
@@ -39,12 +39,5 @@
[% " selected" IF default.$name.0 == field %]>
[% field_descs.$field || field FILTER html %]</option>
[% END %]
-
- [%# Single-select fields are also valid column names. %]
- [% FOREACH field = custom_fields %]
- <option value="[% field.name FILTER html %]"
- [% " selected" IF default.$name.0 == field.name %]>
- [% field.description FILTER html %]</option>
- [% END %]
</select>
[% END %]