Commit bb7585e3 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 522620: Make Bugzilla::Bug->create case-insensitive for version and target_milestone values

Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
parent 99328846
...@@ -37,8 +37,10 @@ use Bugzilla::Flag; ...@@ -37,8 +37,10 @@ use Bugzilla::Flag;
use Bugzilla::FlagType; use Bugzilla::FlagType;
use Bugzilla::Hook; use Bugzilla::Hook;
use Bugzilla::Keyword; use Bugzilla::Keyword;
use Bugzilla::Milestone;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Version;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Component; use Bugzilla::Component;
...@@ -1657,9 +1659,9 @@ sub _check_target_milestone { ...@@ -1657,9 +1659,9 @@ sub _check_target_milestone {
$target = trim($target); $target = trim($target);
$target = $product->default_milestone if !defined $target; $target = $product->default_milestone if !defined $target;
check_field('target_milestone', $target, my $object = Bugzilla::Milestone->check(
[map($_->name, @{$product->milestones})]); { product => $product, name => $target });
return $target; return $object->name;
} }
sub _check_time { sub _check_time {
...@@ -1681,8 +1683,9 @@ sub _check_version { ...@@ -1681,8 +1683,9 @@ sub _check_version {
my ($invocant, $version, $product) = @_; my ($invocant, $version, $product) = @_;
$version = trim($version); $version = trim($version);
($product = $invocant->product_obj) if ref $invocant; ($product = $invocant->product_obj) if ref $invocant;
check_field('version', $version, [map($_->name, @{$product->versions})]); my $object =
return $version; Bugzilla::Version->check({ product => $product, name => $version });
return $object->name;
} }
sub _check_work_time { sub _check_work_time {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment