Closed Bug 621255 Opened 15 years ago Closed 15 years ago

Params without a sortkey should sort to the end

Categories

(Bugzilla :: Administration, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 1 obsolete file)

Currently, if you add a new param panel and don't specify a sortkey, it sorts to the top, between Index and Required Settings. I suspect that is almost never the desired behaviour. It would be better if the default were to sort to the end. Gerv
Attached patch Patch v.1Splinter Review
Assignee: administration → gerv
Attachment #499617 - Flags: review?(mkanat)
(In reply to comment #1) > Created attachment 499617 [details] [diff] [review] > Patch v.1 Gerv, this looks good and worked for me for the most part. The only issue I have with it is when someone has $sortkey set to 0 in their Config.pm meaning they want the menu item to display at the "top" of the list. With this patch it will still display at the bottom. Is it possible for your patch to check for defined instead of a 0 or false value? Dave
Attached patch Patch v.2 (obsolete) — Splinter Review
Good catch. Try this instead. Gerv
Attachment #499617 - Attachment is obsolete: true
Attachment #500185 - Flags: review?(dkl)
Attachment #499617 - Flags: review?(mkanat)
Comment on attachment 500185 [details] [diff] [review] Patch v.2 Works for me. r=dkl
Attachment #500185 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval4.0?
Comment on attachment 500185 [details] [diff] [review] Patch v.2 >+ defined($item->{'sortkey'}) || ($item->{'sortkey'} = 100000); This would be much clearer as $item->{sortkey} ||= 100000 as we have no sortkey = 0.
LpSolit: so are you disagreeing with comment 2? Gerv
(In reply to comment #2) > Gerv, this looks good and worked for me for the most part. The only issue I > have with it is when someone has $sortkey set to 0 in their Config.pm meaning > they want the menu item to display at the "top" of the list. We have no such sortkey.
(In reply to comment #6) > LpSolit: so are you disagreeing with comment 2? Yes.
Comment on attachment 499617 [details] [diff] [review] Patch v.1 OK, back to plan A. Gerv
Attachment #499617 - Attachment is obsolete: false
Attachment #499617 - Flags: review?(dkl)
Attachment #500185 - Attachment is obsolete: true
Comment on attachment 499617 [details] [diff] [review] Patch v.1 Well is LpSolit says that extensions should never need to have a $sortkey equal to 0 (which I am not so sure), then this works fine for me. r=dkl
Attachment #499617 - Flags: review?(dkl) → review+
(In reply to comment #10) > Well is LpSolit says that extensions should never need to have a $sortkey equal > to 0 (which I am not so sure), then this works fine for me. r=dkl Sortkeys are currently hardcoded and none is 0. Also, we never guaranteed that a "false" sortkey (from a Perl point of view, i.e. undef, "" or 0) would be treated correctly. So I much prefer to enforce this rule than to get unexpected behaviors.
Severity: minor → enhancement
Flags: approval?
Flags: approval4.0?
Flags: approval4.0-
Flags: approval+
Target Milestone: --- → Bugzilla 4.2
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified editparams.cgi Committed revision 7677. Gerv
Status: ASSIGNED → RESOLVED
Closed: 15 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: