Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#13361 closed (fixed)

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

Reported by: carljm Owned by: carljm
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: UI/UX:

Description

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 carljm 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 5 years ago by carljm

comment:2 Changed 5 years ago by carljm

  • Has patch set

comment:3 Changed 5 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 5 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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