[Django] #33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter” interface

5 views
Skip to first unread message

Django

unread,
Aug 7, 2022, 6:18:25 PM8/7/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard | Owner: nobody
Saeuberlich |
Type: Bug | Status: new
Component: | Version: 4.1
contrib.admin | Keywords: javascript, admin,
Severity: Normal | frontend
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
As the summary says. This happens if you use one of the built in Many-To-
Many filters
([https://docs.djangoproject.com/en/4.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.filter_horizontal]).
Both filters (horizontal & vertical) provoke this behavior. If you don't
use any of the filters, everything works as expected. Same goes for Django
version smaller than 4.1.

Therefore, I don't think this is a backend problem. I think the JavaScript
wasn't updated with all necesary changes from v.4.1. Or maybe there is a
problem with the template engine?!?

Finally, a minimalist project for error reproduction:
[https://github.com/aDramaQueen/django-many-to-many-error]

--
Ticket URL: <https://code.djangoproject.com/ticket/33904>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 8, 2022, 1:09:02 AM8/8/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard Saeuberlich | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: javascript, admin, | Triage Stage:
frontend | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => fixed


Comment:

Thanks for the report! It was a regression in
fe7dbef5867c577995f0fc849d8dfdb8f2e6bbfa fixed in
0756c61f2ada56e4ae625589099c0141a77737eb (Django 4.1.1).

--
Ticket URL: <https://code.djangoproject.com/ticket/33904#comment:1>

Django

unread,
Aug 23, 2022, 8:17:45 AM8/23/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard Saeuberlich | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: javascript, admin, | Triage Stage:
frontend | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carsten Fuchs):

* cc: Carsten Fuchs (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33904#comment:2>

Django

unread,
Aug 23, 2022, 9:20:48 AM8/23/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard Saeuberlich | Owner: nobody
Type: Bug | Status: new

Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution:
Keywords: javascript, admin, | Triage Stage:
frontend | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carsten Fuchs):

* status: closed => new
* resolution: fixed =>


Comment:

As discussed at https://groups.google.com/g/django-
developers/c/3W3eV6qyMeA/m/7_pif1UOAgAJ, the issue does not seem to be
fixed: As demonstrated by the OP at https://github.com/aDramaQueen/django-
many-to-many-error, new objects that use a many-to-many relationship with
horizontal oder vertical filters cannot be created (error: "This field is
required" even if a value is given).

--
Ticket URL: <https://code.djangoproject.com/ticket/33904#comment:3>

Django

unread,
Aug 23, 2022, 10:05:49 AM8/23/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard Saeuberlich | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution:
Keywords: javascript, admin, | Triage Stage:
frontend | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hmmm. I've just downloaded the project and testing on `main`,
`stable/4.1.x`, the `4.1` tag, and `stable/4.0.x` I'm not seeing the
behaviour. 🤔

Under normal circumstances I'd close as `worksforme`, but since you just
re-opened it Carsten, presumably you are seeing it... 😬
Can you dig a little?

(Browser cache maybe? 🤔)

(I did a video but it's too big to upload to trac.)

--
Ticket URL: <https://code.djangoproject.com/ticket/33904#comment:4>

Django

unread,
Aug 23, 2022, 11:25:20 AM8/23/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard Saeuberlich | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: fixed

Keywords: javascript, admin, | Triage Stage:
frontend | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => fixed


Comment:

I also saw this issue and confirmed that it's fixed by the commit in
comment 1. If you still see the problem `admin/js/change_form.js` may be
cached by your browser.

--
Ticket URL: <https://code.djangoproject.com/ticket/33904#comment:5>

Django

unread,
Aug 25, 2022, 4:13:42 AM8/25/22
to django-...@googlegroups.com
#33904: Many-To-Many field is deleted/ignored from internal JavaScript “filter”
interface
-------------------------------------+-------------------------------------
Reporter: Richard Saeuberlich | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: javascript, admin, | Triage Stage:
frontend | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carsten Fuchs):

Ok, many thanks for everyone's help! Sorry for the noise!

--
Ticket URL: <https://code.djangoproject.com/ticket/33904#comment:6>

Reply all
Reply to author
Forward
0 new messages