Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#13361 closed (fixed)

If admin actions are disabled, admin jQuery is not included (thus e.g. prepopulated_fields breaks)

Reported by: Carl Meyer Owned by: Carl Meyer
Component: contrib.admin Version: master
Severity: Keywords: jquery
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


ModelAdmin currently only includes jQuery in its media definition if there are admin actions defined (this must be a holdover from a time when only admin actions used jQuery?). Because of the site-wide "delete" action, this usually makes no difference. But if you create a ModelAdmin with explicit "actions = None", all jQuery-dependent admin JS breaks: this includes at least prepopulated_fields.

Attachments (1)

13361_r12995.diff (2.4 KB) - added by Carl Meyer 11 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by Carl Meyer

Related: when Django 1.2 ships, it should be clear to reusable app authors whether the namespaced django.jquery is private and not-to-be-relied-upon, or is reliable for reusable-app use and guaranteed to be present on ModelAdmin pages. Per discussion with jezdez on IRC, it will be the latter. I'll attach a patch that makes Django's admin jQuery always included, fixing this bug, and includes a documentation note about the admin's namespaced jquery.

Changed 11 years ago by Carl Meyer

Attachment: 13361_r12995.diff added

comment:2 Changed 11 years ago by Carl Meyer

Has patch: set

comment:3 Changed 11 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:4 Changed 11 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [12997]) Fixed #13361 - Made sure jQuery is always included in the admin changelist and changeform. Thanks to Carl Meyer for report and patch.

comment:5 Changed 9 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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