Opened 25 hours ago

Last modified 5 hours ago

#36829 assigned Bug

Breaking change in ClearableFileInput

Reported by: Johannes Maron Owned by: Johannes Maron
Component: Forms Version: 6.0
Severity: Release blocker Keywords:
Cc: Johannes Maron, Antoliny Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description (last modified by Johannes Maron)

Howdy y'all,

#35892 flipped django.forms.widgets.ClearableFileInput.use_fieldset from false to true.

The change can be found here: https://github.com/django/django/blame/4187da258fe212d494cb578a0bc2b52c4979ab95/django/forms/widgets.py#L533

This changes the form rendering outside the admin too. Probably just a small oversight and not an intentional change, since changes weren't accompanied by release notes.

Anyhow, both the input and the use_fieldset are part of the public documentation, and changes must undergo deprecation.

The problem gets amplified with #36828, since the current fieldset implementation violates HTML and WCAG 2.1

The only affected version is 6.0. I would recommend providing a regression patch in the next bugfix release.

Cheers!
Joe

Attachments (1)

ticket-36829.patch (886 bytes ) - added by Johannes Maron 6 hours ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Johannes Maron, 25 hours ago

Description: modified (diff)

comment:2 by Tim Graham, 22 hours ago

It might be that only AdminFileWidget (the ClearableFileInput used in admin forms) should have that attribute.

comment:3 by Antoliny, 16 hours ago

Thank you for reporting this issue, Joe :)

In my view, using a fieldset for ClearableFileInput itself makes sense.
However, I also agree that it’s a problem that a change related to the admin affected form rendering outside of the admin as well (and that this wasn’t communicated).

As Tim suggested, should this change be limited to the admin only?

comment:4 by Antoliny, 16 hours ago

Cc: Antoliny added

comment:5 by Johannes Maron, 6 hours ago

Owner: set to Johannes Maron
Status: newassigned

Agreed, let's limit the change to the admin, since its widgets aren't publicly documented.

I'll attach a potential patch.

by Johannes Maron, 6 hours ago

Attachment: ticket-36829.patch added

comment:6 by Johannes Maron, 5 hours ago

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