Bug 54779 - Do not crash with a code error, but warn user in the case of different product case
git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1448 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
7017896252
commit
19e01dc112
|
@ -862,6 +862,10 @@ sub can_enter_product {
|
||||||
elsif (!@{$product->versions}) {
|
elsif (!@{$product->versions}) {
|
||||||
ThrowUserError ('missing_version', { product => $product });
|
ThrowUserError ('missing_version', { product => $product });
|
||||||
}
|
}
|
||||||
|
# It could have the name in a different case :)
|
||||||
|
elsif (!blessed($input) && $product->name ne $input) {
|
||||||
|
ThrowUserError ('product_invalid_case', { product => $input, suggested => $product->name });
|
||||||
|
}
|
||||||
|
|
||||||
die "can_enter_product reached an unreachable location.";
|
die "can_enter_product reached an unreachable location.";
|
||||||
}
|
}
|
||||||
|
@ -874,15 +878,15 @@ sub get_enterable_products {
|
||||||
return $self->{enterable_products};
|
return $self->{enterable_products};
|
||||||
}
|
}
|
||||||
|
|
||||||
# All products which the user has "Entry" access to.
|
# All products which the user has "Entry" access to.
|
||||||
my @enterable_ids = @{$dbh->selectcol_arrayref(
|
my @enterable_ids = @{$dbh->selectcol_arrayref(
|
||||||
'SELECT products.id FROM products
|
'SELECT products.id FROM products
|
||||||
LEFT JOIN group_control_map
|
LEFT JOIN group_control_map
|
||||||
ON group_control_map.product_id = products.id
|
ON group_control_map.product_id = products.id
|
||||||
AND group_control_map.entry != 0
|
AND group_control_map.entry != 0
|
||||||
AND group_id NOT IN (' . $self->groups_as_string . ')
|
AND group_id NOT IN (' . $self->groups_as_string . ')
|
||||||
WHERE group_id IS NULL
|
WHERE group_id IS NULL
|
||||||
AND products.isactive = 1') || []};
|
AND products.isactive = 1') || []};
|
||||||
|
|
||||||
if (@enterable_ids) {
|
if (@enterable_ids) {
|
||||||
# And all of these products must have at least one component
|
# And all of these products must have at least one component
|
||||||
|
|
|
@ -1716,6 +1716,10 @@
|
||||||
I could not figure out what you wanted to do.
|
I could not figure out what you wanted to do.
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
[% ELSIF error == "product_invalid_case" %]
|
||||||
|
You have requested the product name "[% product | html %]", did you mean
|
||||||
|
"[% suggested | html %]"?
|
||||||
|
|
||||||
[% ELSIF error == "incorrect_field_values" %]
|
[% ELSIF error == "incorrect_field_values" %]
|
||||||
[% IF bug_id %]
|
[% IF bug_id %]
|
||||||
[% terms.Bug %] [%+ bug_id %]:<br />
|
[% terms.Bug %] [%+ bug_id %]:<br />
|
||||||
|
|
Loading…
Reference in New Issue