From 8f33041e6542f12e6897ef6ed7a67c43a118c504 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Wed, 23 Jun 2010 17:39:11 -0700 Subject: 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 --- Bugzilla/Search/Recent.pm | 4 +--- Bugzilla/Search/Saved.pm | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'Bugzilla/Search') 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, -- cgit v1.2.3-24-g4f1b