Opened 18 years ago

Closed 18 years ago

Last modified 17 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 Holovaty
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: no UI/UX: no

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@…> 18 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)

by Tom Tobin <korpios@…>, 18 years ago

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

comment:1 by Jacob, 18 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by korpios, 17 years ago

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