Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28157 closed Bug (fixed)

Options order is lost in choicefields when mixing grouped and non-grouped options.

Reported by: Paul Antropius Owned by: Tim Graham
Component: Forms Version: 1.11
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

With this tuple (fetched from django documentation),

MEDIA_CHOICES = (
    ('Audio', (
            ('vinyl', 'Vinyl'),
            ('cd', 'CD'),
        )
    ),
    ('Video', (
            ('vhs', 'VHS Tape'),
            ('dvd', 'DVD'),
        )
    ),
    ('unknown', 'Unknown'),
)

the "unknown" option is displayed at the beginning of the dropbox.

More generally, every non-grouped options are displayed first, followed by grouped options.

If an embedded mix of them is needed -- which is my case -- the order is entirely lost.

I guess this is not the expected behavior.

Thanks for your assistance,

Change History (6)

comment:1 by Tim Graham, 7 years ago

Easy pickings: unset
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Regression bisected to b52c73008a9d67e9ddbb841872dc15cdd3d6ee01 (template-based widget rendering).

comment:2 by Tim Graham, 7 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned

comment:3 by Tim Graham, 7 years ago

Has patch: set

comment:4 by Claude Paroz, 7 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by GitHub <noreply@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In d302e2c0:

Fixed #28157 -- Fixed choice ordering in form fields with grouped and non-grouped options.

Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01.

comment:6 by Tim Graham <timograham@…>, 7 years ago

In 06156014:

[1.11.x] Fixed #28157 -- Fixed choice ordering in form fields with grouped and non-grouped options.

Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01.

Backport of d302e2c09c281e6b1e187f704f656e5e79e69246 from master

Note: See TracTickets for help on using tickets.
Back to Top