Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related object popup not working in Django admin #1316

Closed
ctrengove opened this issue Sep 30, 2022 · 1 comment
Closed

Related object popup not working in Django admin #1316

ctrengove opened this issue Sep 30, 2022 · 1 comment

Comments

@ctrengove
Copy link

Recent versions of Django have changed the way they "name" the popup window by appending a numeric index to the ID of the field in question. So instead of something like id_image_lookup, the popup window name becomes id_image_lookup__1. Apparently this is intended to allow multiple simultaneous popups for a single field.

This change means that the code in static/filer/js/addons/popup_handling.js no longer works, Specifically, the function dismissRelatedImageLookupPopup fails to retrieve the ID of the field being edited.

This looks like it can be fixed by adding the following line to windowname_to_id (in the same file).

text = text.replace(/__\d+$/, '');

This change to the Django admin was made on 30 Sep 2021, so I think the issue will be in 3.2.8 onwards. The relevant Django file is RelatedObjectLookups.js.

@fsbraun
Copy link
Member

fsbraun commented Dec 21, 2022

Solved by #1326

@fsbraun fsbraun closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants