Commit 65a82306 authored by terry%mozilla.org's avatar terry%mozilla.org

Keywords were already enforced to never differ only in capitalization. So,…

Keywords were already enforced to never differ only in capitalization. So, changed the code so that case no longer matters when typing in the name of a keyword.
parent 0aa9bdc0
...@@ -36,7 +36,6 @@ sub sillyness { ...@@ -36,7 +36,6 @@ sub sillyness {
$zz = $::unconfirmedstate; $zz = $::unconfirmedstate;
$zz = @::components; $zz = @::components;
$zz = @::default_column_list; $zz = @::default_column_list;
$zz = @::keywordsbyname;
$zz = @::legal_keywords; $zz = @::legal_keywords;
$zz = @::legal_platform; $zz = @::legal_platform;
$zz = @::legal_priority; $zz = @::legal_priority;
...@@ -405,7 +404,7 @@ sub GenerateSQL { ...@@ -405,7 +404,7 @@ sub GenerateSQL {
if ($value eq '') { if ($value eq '') {
next; next;
} }
my $id = $::keywordsbyname{$value}; my $id = GetKeywordIdFromName($name);
if ($id) { if ($id) {
push(@list, "$table.keywordid = $id"); push(@list, "$table.keywordid = $id");
} else { } else {
......
...@@ -104,7 +104,7 @@ sub SyncAnyPendingShadowChanges { ...@@ -104,7 +104,7 @@ sub SyncAnyPendingShadowChanges {
$shadowchanges = 0; $shadowchanges = 0;
} }
} }
my $dosqllog = (-e "data/sqllog") && (-w "data/sqllog"); my $dosqllog = (-e "data/sqllog") && (-w "data/sqllog");
...@@ -472,6 +472,7 @@ sub GenerateVersionTable { ...@@ -472,6 +472,7 @@ sub GenerateVersionTable {
SendSQL("SELECT id, name FROM keyworddefs ORDER BY name"); SendSQL("SELECT id, name FROM keyworddefs ORDER BY name");
while (MoreSQLData()) { while (MoreSQLData()) {
my ($id, $name) = FetchSQLData(); my ($id, $name) = FetchSQLData();
$name = lc($name);
$::keywordsbyname{$name} = $id; $::keywordsbyname{$name} = $id;
push(@::legal_keywords, $name); push(@::legal_keywords, $name);
} }
...@@ -485,6 +486,14 @@ sub GenerateVersionTable { ...@@ -485,6 +486,14 @@ sub GenerateVersionTable {
} }
sub GetKeywordIdFromName {
my ($name) = (@_);
$name = lc($name);
return $::keywordsbyname{$name};
}
# Returns the modification time of a file. # Returns the modification time of a file.
......
...@@ -37,7 +37,6 @@ use vars %::versions, ...@@ -37,7 +37,6 @@ use vars %::versions,
%::components, %::components,
%::COOKIE, %::COOKIE,
%::MFORM, %::MFORM,
%::keywordsbyname,
%::legal_keywords, %::legal_keywords,
%::legal_opsys, %::legal_opsys,
%::legal_platform, %::legal_platform,
...@@ -549,7 +548,7 @@ if ($::FORM{'keywords'}) { ...@@ -549,7 +548,7 @@ if ($::FORM{'keywords'}) {
if ($keyword eq '') { if ($keyword eq '') {
next; next;
} }
my $i = $::keywordsbyname{$keyword}; my $i = GetKeywordIdFromName($keyword);
if (!$i) { if (!$i) {
PuntTryAgain("Unknown keyword named <code>$keyword</code>. " . PuntTryAgain("Unknown keyword named <code>$keyword</code>. " .
"<P>The legal keyword names are " . "<P>The legal keyword names are " .
......
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