summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-06-24 02:39:11 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-06-24 02:39:11 +0200
commit8f33041e6542f12e6897ef6ed7a67c43a118c504 (patch)
treec5caf60f706dfa1043a69e135b5246bd63455aae /Bugzilla/Search
parent0a4878ccff5b9c281b018ad6c13fa5ac40986708 (diff)
downloadbugzilla-8f33041e6542f12e6897ef6ed7a67c43a118c504.tar.gz
bugzilla-8f33041e6542f12e6897ef6ed7a67c43a118c504.tar.xz
Bug 572602: Change the way that Bugzilla::Object determines what fields
are required for create(). It now assumes that any column that is NOT NULL and has not DEFAULT in the database is required. We also shift the burden of throwing errors about empty values to the validators. This fixes the bug that Bugzilla::Bug->create() wasn't populating default values for fields if they weren't specified in the create() parameters. r=timello, a=mkanat
Diffstat (limited to 'Bugzilla/Search')
-rw-r--r--Bugzilla/Search/Recent.pm4
-rw-r--r--Bugzilla/Search/Saved.pm2
2 files changed, 1 insertions, 5 deletions
diff --git a/Bugzilla/Search/Recent.pm b/Bugzilla/Search/Recent.pm
index 1498af034..79257a851 100644
--- a/Bugzilla/Search/Recent.pm
+++ b/Bugzilla/Search/Recent.pm
@@ -34,8 +34,6 @@ use Bugzilla::Util;
use constant DB_TABLE => 'profile_search';
use constant LIST_ORDER => 'id';
-use constant REQUIRED_CREATE_FIELDS => ();
-
use constant DB_COLUMNS => qw(
id
user_id
@@ -120,7 +118,7 @@ sub _check_user_id {
sub _check_bug_list {
my ($invocant, $list) = @_;
- my @bug_ids = ref($list) ? @$list : split(',', $list);
+ my @bug_ids = ref($list) ? @$list : split(',', $list || '');
detaint_natural($_) foreach @bug_ids;
return join(',', @bug_ids);
}
diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm
index cf043beb1..cb6371469 100644
--- a/Bugzilla/Search/Saved.pm
+++ b/Bugzilla/Search/Saved.pm
@@ -48,8 +48,6 @@ use constant DB_COLUMNS => qw(
query_type
);
-use constant REQUIRED_CREATE_FIELDS => qw(name query);
-
use constant VALIDATORS => {
name => \&_check_name,
query => \&_check_query,