Commit 0ed8d173 authored by jouni%heikniemi.net's avatar jouni%heikniemi.net

Bug 86051: Enable changing product name case.

Patch by GavinS <bugzilla@chimpychompy.org> r=jouni, a=justdave
parent d2bec89f
...@@ -306,13 +306,27 @@ if ($action eq 'new') { ...@@ -306,13 +306,27 @@ if ($action eq 'new') {
PutTrailer($localtrailer); PutTrailer($localtrailer);
exit; exit;
} }
if (TestProduct($product)) {
my $existing_product = TestProduct($product);
# Check for exact case sensitive match:
if ($existing_product eq $product) {
print "The product '$product' already exists. Please press\n"; print "The product '$product' already exists. Please press\n";
print "<b>Back</b> and try again.\n"; print "<b>Back</b> and try again.\n";
PutTrailer($localtrailer); PutTrailer($localtrailer);
exit; exit;
} }
# Next check for a case-insensitive match:
if (lc($existing_product) eq lc($product)) {
print "The new product '$product' differs from existing product ";
print "'$existing_product' only in case. Please press\n";
print "<b>Back</b> and try again.\n";
PutTrailer($localtrailer);
exit;
}
my $version = trim($::FORM{version} || ''); my $version = trim($::FORM{version} || '');
if ($version eq '') { if ($version eq '') {
...@@ -1190,7 +1204,9 @@ if ($action eq 'update') { ...@@ -1190,7 +1204,9 @@ if ($action eq 'update') {
PutTrailer($localtrailer); PutTrailer($localtrailer);
exit; exit;
} }
if (TestProduct($product)) {
if (lc($product) ne lc($productold) &&
TestProduct($product)) {
print "Sorry, product name '$product' is already in use."; print "Sorry, product name '$product' is already in use.";
SendSQL("UNLOCK TABLES"); SendSQL("UNLOCK TABLES");
PutTrailer($localtrailer); PutTrailer($localtrailer);
......
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