Commit 2cb3440a authored by Sunil Joshi's avatar Sunil Joshi Committed by Frédéric Buclin

Bug 308709: Misleading confirmation when entering an invalid sort key for a field value

r/a=LpSolit
parent 533d024f
......@@ -256,7 +256,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 });
......
......@@ -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" %]
......
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