Opened 2 years ago

Closed 2 years ago

Last modified 2 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 Changed 2 years ago by Tim Graham

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

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

comment:2 Changed 2 years ago by Tim Graham

Owner: changed from nobody to Tim Graham
Status: newassigned

comment:3 Changed 2 years ago by Tim Graham

Has patch: set

comment:4 Changed 2 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

comment:5 Changed 2 years ago by GitHub <noreply@…>

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 Changed 2 years ago by Tim Graham <timograham@…>

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