Opened 5 months ago

Closed 5 months ago

#35644 closed Bug (duplicate)

`AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in their `Media`

Reported by: Michał Pokusa Owned by:
Component: contrib.admin Version: 5.0
Severity: Normal Keywords: media, widgets, admin
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

While developing an extension for Django I noticed that both AdminDateWidget and AdminTimeWidget do not have admin/js/core.js in their Media nor do they inherit it from any parent class.

The admin/js/core.js, specifically the quickElement function is used inside admin/js/admin/DateTimeShortcuts.js, which they both reference.

Usually, this is not an issue as admin/js/core.js is referenced in ModelAdmin.media, but nevertheless this seems like it was missed rather than an intended way. Other admin widget - FilteredSelectMultiple - references admin/js/core.js together with other scripts needed for it to work.

Wraping it up, I suggest adding admin/js/core.js to both AdminDateWidget and AdminTimeWidget to unify them with FilteredSelectMultiple.

Change History (2)

comment:1 by Matthias Kestenholz, 5 months ago

Component: Formscontrib.admin
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

comment:2 by Natalia Bidart, 5 months ago

Resolution: duplicate
Status: newclosed
Triage Stage: AcceptedUnreviewed

Thank you Michał for this report. This is a duplicate of #9576, though I'm a little torn about the wontfix resolution from 15 years ago because the main counterargument is, as you said in the description, that FilteredSelectMultiple does include it explicitly.

Given the current Django triage process, I have to close this as a duplicate of #9576, but if you feel strong about this, you could start a new conversation on the Django Forum, where you'll reach a wider audience and likely get extra feedback. If there is a community agreement that this change is desired, I will be happy to re-open #9576.

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