[Django] #36284: Related field popups are broken (selecting values works but the popup doesn't close)

6 views
Skip to first unread message

Django

unread,
Apr 1, 2025, 8:44:43 AM4/1/25
to django-...@googlegroups.com
#36284: Related field popups are broken (selecting values works but the popup
doesn't close)
-------------------------------------+-------------------------------------
Reporter: Matthias Kestenholz | Type: Bug
Status: new | Component:
| contrib.admin
Version: 5.2 | Severity: Release
| blocker
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
https://github.com/django/django/commit/91bebf1adb43561b54bac18e76224759dc70acb3
broke the functionality by accessing `window.relatedWindows` instead of
the module-local `relatedWindows` variable; `window.relatedWindows` is
only defined when running the tests but not when running in the browser.

This affects all projects using `raw_id_fields` to select existing
objects.

The patch attached here fixes the problem and the unit test, but it's
obviously really ugly.

The problem wasn't discovered by me but by https://github.com/yoshson/ .
I'm reporting this here and now because of the expected release date of
Django 5.2.
--
Ticket URL: <https://code.djangoproject.com/ticket/36284>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 1, 2025, 8:44:49 AM4/1/25
to django-...@googlegroups.com
#36284: Related field popups are broken (selecting values works but the popup
doesn't close)
-------------------------------------+-------------------------------------
Reporter: Matthias Kestenholz | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Matthias Kestenholz):

* Attachment "patch.txt" added.

Django

unread,
Apr 1, 2025, 10:50:36 AM4/1/25
to django-...@googlegroups.com
#36284: Related field popups are broken (selecting values works but the popup
doesn't close)
--------------------------------------+------------------------------------
Reporter: Matthias Kestenholz | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: RelatedObjectLookups | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Natalia Bidart):

* keywords: => RelatedObjectLookups
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted

Comment:

I can reproduce, the bug is that once an item is selected in the
`raw_id_fields` popup, the popup is not automatically closed. We need to
investigate a solution, potentially a revert.

Marking as patch needs improvement because we need to find a cleaner
solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/36284#comment:1>
Reply all
Reply to author
Forward
0 new messages