diff options
author | Sunil Joshi <joshi_sunil@in.com> | 2012-09-19 21:55:56 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-09-19 21:55:56 +0200 |
commit | c658f1b025d74ae9b4c7716d81377b68a1cc5a52 (patch) | |
tree | e461c2d47edf64ac6f47a66061f4343b3e656aed | |
parent | 526f38381f781317eb58d08800232172d79edd9e (diff) | |
download | bugzilla-c658f1b025d74ae9b4c7716d81377b68a1cc5a52.tar.gz bugzilla-c658f1b025d74ae9b4c7716d81377b68a1cc5a52.tar.xz |
Bug 308709: Misleading confirmation when entering an invalid sort key for a field value
r/a=LpSolit
-rw-r--r-- | Bugzilla/Field/Choice.pm | 2 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index 2b6d8195f..52fb7b409 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -257,7 +257,7 @@ sub _check_sortkey { return 0 if !$value; # Store for the error message in case detaint_natural clears it. my $orig_value = $value; - detaint_natural($value) + (detaint_natural($value) && $value <= MAX_SMALLINT) || ThrowUserError('fieldvalue_sortkey_invalid', { sortkey => $orig_value, field => $invocant->field }); diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index a8eabb0d7..91640fe4a 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -577,9 +577,9 @@ [% ELSIF error == "fieldvalue_sortkey_invalid" %] [% title = "Invalid Field Value Sortkey" %] - The sortkey '[% sortkey FILTER html %]' for the - [%+ field.description FILTER html %] field is not a valid - (positive) number. + The sortkey '[% sortkey FILTER html %]' for the + [%+ field.description FILTER html %] field must be an integer + between 0 and [% constants.MAX_SMALLINT FILTER none %]. [% ELSIF error == "fieldvalue_still_has_bugs" %] [% title = "You Cannot Delete This Field Value" %] |