Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#1404 closed defect (fixed)

[patch] admin m2m item-add popup broken when `filter_interface` is set

Reported by: Tom Tobin <korpios@…> Owned by: adrian
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When filter_interface is set for a ManyToManyField, the admin popup for adding a new m2m item breaks upon saving the new item. The item is added to the database; the breakage occurs when the dismissAddAnotherPopup function in RelatedObjectLookups.js tries to look for the related select element, only to fail to find it because the Javascript code for filter_interface alters the DOM to have two new elements with changed ids (ending in "_from" and "_to").

The attached patch alters dismissAddAnotherPopup to look for the select element's id, and fall back to looking for id + "_to"; the latter will result in the function properly adding the new item via SelectBox calls.

Attachments (1)

trunk-admin_popup_selectfilter_fix.diff (1.2 KB) - added by Tom Tobin <korpios@…> 10 years ago.
patch against r2408 of trunk to fix admin popup breakage with m2m fields and filter_interface

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Tom Tobin <korpios@…>

patch against r2408 of trunk to fix admin popup breakage with m2m fields and filter_interface

comment:1 Changed 10 years ago by jacob

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

(In [2413]) Fixed #1404 (thanks, Tom Tobin)

comment:2 Changed 8 years ago by korpios

  • Reporter changed from Tom Tobin <korpios@…> to Tom Tobin <korpios@…>
Note: See TracTickets for help on using tickets.
Back to Top