Opened 10 years ago

Closed 8 years ago

#22955 closed Bug (fixed)

Admin: reloading clears filter_horizontal entries on Firefox

Reported by: anonymous Owned by: elky
Component: contrib.admin Version: 1.6
Severity: Normal Keywords: admin filter_horizontal reload
Cc: cmawebsite@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


In an admin page with a filter_horizontal, loading a page normally will load and save the entries of a filter_horizontal properly, but if you reload the filter_horizontal will be emptied, and if that page is saved those entries will be lost.

Reproduced with: Django 1.4.9, 1.6.2 and 1.6.5

Change History (15)

comment:1 by Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

I can reproduce with Firefox 30, but not Chrome 35. Which browser are you using? Tentatively accepting, but it may be a browser bug and not something we can/should fix in Django.

comment:2 by Tim Graham, 10 years ago

Resolution: duplicate
Status: newclosed

Actually this has been reported in #13614.

comment:3 by Ben Kornrath, 9 years ago

I think #13614 is actually a separate issue (although it seems there has been some discussion about this issue on #13614). The test html in comment 16 ( seems to be working on Firfox 36.

I can confirm that this is still problem on Firefox 36 with Django 1.6.10, 1.7.5, 1.8b1. How can I reopen this bug?

comment:4 by Ben Kornrath, 9 years ago

Resolution: duplicate
Status: closednew

comment:5 by Ben Kornrath, 9 years ago

This pull request adds a failing test case to demonstrate the problem.

I'm not exactly sure what the way forward is for this issue. There seems to be a couple tickets that have full rewrite of the select filter js code. My primary interest is ensuring that any re-write of the select filter js code incorporates this test so that this problem gets fixed.

comment:6 by Collin Anderson, 9 years ago

Cc: cmawebsite@… added

comment:7 by Tim Graham, 9 years ago

Summary: Admin: reloading clears filter_horizontal entriesAdmin: reloading clears filter_horizontal entries on Firefox

I tested on Internet Explorer 9 and there's no problem there either. To me, this still seems like an issue that would be better addressed in Firefox itself so older versions of Django can benefit from the fix as well.

comment:8 by elky, 8 years ago

Owner: changed from nobody to elky
Status: newassigned

comment:9 by elky, 8 years ago

Just made pull request that fixes this problem:

comment:10 by Tim Graham, 8 years ago

I couldn't reproduce this on master with Firefox 43.0 and bisected the change to 4a438e400b7ce0ab9d0b6876196cbe8d620a4171. It seems plausible this fixed the issue as the admin views are wrapped in never_cache(). Can you reproduce those findings?

comment:11 by elky, 8 years ago

Can't reproduce it in the latest Firefox as well. Using Django 1.9. Seems my fix works for lower Django versions only.

comment:12 by Tim Graham, 8 years ago

Has patch: set
Patch needs improvement: set

I think we can backport the fix for #13008 for 1.8 to fix this possible data loss issue there. Let's try to get the selenium test in your pull request working so we can add that too. Hopefully my review comments will help.

comment:13 by Tim Graham, 8 years ago

I backported the fix for #13008 to 1.8 in b51086d57313e7ea857f4b96b62d25e600ee0a8d so this should be resolved there.

comment:14 by Tim Graham <timograham@…>, 8 years ago

In 0cc32a8f:

Refs #22955 -- Added test for admin's many-to-many widget refresh data loss bug.

This was fixed by 4a438e400b7ce0ab9d0b6876196cbe8d620a4171.

comment:15 by Tim Graham, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top