Opened 15 months ago
Closed 15 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 , 15 months ago
| Component: | Forms → contrib.admin |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → Bug |
comment:2 by , 15 months ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
| Triage Stage: | Accepted → Unreviewed |
Thank you Michał for this report. This is a duplicate of #9576, though I'm a little torn about the
wontfixresolution from 15 years ago because the main counterargument is, as you said in the description, thatFilteredSelectMultipledoes include it explicitly.Given the current Django triage process, I have to close this as a
duplicateof #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.