Closed Bug 308709 Opened 19 years ago Closed 12 years ago

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

Categories

(Bugzilla :: Administration, task)

2.20
task
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: wicked, Assigned: sjoshi)

Details

Attachments

(1 file, 1 obsolete file)

In editvalues.cgi, entering a too big sort key leads to a confirmation message
like "Updated field value sortkey to: '99999999999999999999'." This is
misleading because the sortkey was actually set to 32767 which is the maximum
value allowed for a sortkey. Either correct the confirmation value or throw an
user error for invalid sortkeys. Note that entering a negative sort key already
shows an error message.
I saw the same problem a few days ago when working on a patch.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Before that,
I checked adding negative sortkey in milestone and i was able to do that.. but from 
editvalues.cgi its not allowing me.

Are we allowing negative sortkey values in bugzilla?
If yes we need to fix this here also and allow negative values of sortkey in editvalues.cgi.The fix for this is going to be something like while doing the same in editmilestone.cgi page.

Let me know your thoughts on this.
No negative sortkeys allowed for field values. Milestones are an exception. The only legal values are 0 - 32767.
Attached patch Patch (obsolete) β€” β€” Splinter Review
Attachment #661604 - Flags: review?(LpSolit)
Comment on attachment 661604 [details] [diff] [review]
Patch

>=== modified file 'Bugzilla/Field/Choice.pm'

>+    (detaint_natural($value)  && $value <= MAX_SMALLINT)

Nit: remove the extra whitespace before &&.



>=== modified file 'template/en/default/global/user-error.html.tmpl'

>-    The sortkey '[% sortkey FILTER html %]' for the 
>-    [%+ field.description FILTER html %] field is not a valid 
>-    (positive) number.
>+    The sort key <em>'[% sortkey FILTER html %]'</em> must be an integer
>+    between 0 and [% constants.MAX_SMALLINT FILTER none %].

Leave "sortkey" alone (do not split it). Also, there is no reason to remove [%+ field.description FILTER html %] from the error message. Please write:

  The sortkey '[% sortkey FILTER html %]' for the [%+ field.description FILTER html %]
  field must be an integer between 0 and [% constants.MAX_SMALLINT FILTER none %].
Attachment #661604 - Flags: review?(LpSolit) → review-
Assignee: administration → joshi_sunil
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 4.4
Attachment #661604 - Attachment is obsolete: true
Attachment #661618 - Flags: review?(LpSolit)
Comment on attachment 661618 [details] [diff] [review]
Re-Patch, incorporating review comments.

r=LpSolit
Attachment #661618 - Flags: review?(LpSolit) → review+
Flags: approval4.4+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Field/Choice.pm
modified template/en/default/global/user-error.html.tmpl
Committed revision 8397.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/Field/Choice.pm
modified template/en/default/global/user-error.html.tmpl
Committed revision 8393.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: