From 028d2808ab935fc14e5367369e0d21ed394d0614 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 16 Jul 2015 15:13:58 +0800 Subject: Bug 1184456 - cannot create a new product with 'detect' as the default platform --- Bugzilla/Product.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Bugzilla/Product.pm') diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 3e74b9afd..5837d8457 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -94,6 +94,11 @@ sub create { my $version = delete $params->{version}; my $create_series = delete $params->{create_series}; + # Some fields can be NULLs + foreach my $field (qw( default_op_sys_id default_platform_id )) { + $params->{$field} = undef if $params->{$field} eq ''; + } + my $product = $class->insert_create_data($params); Bugzilla->user->clear_product_cache(); -- cgit v1.2.3-24-g4f1b