Collapsible elements in admin stopped working with latest release

54 views
Skip to first unread message

Paul Michalski

unread,
Jul 12, 2019, 1:18:16 PM7/12/19
to django...@googlegroups.com

I just upgraded from Django 2.1.3 to 2.2.3, at which point collapsible elements in the admin interface stopped working. I’m using IE11, and in the console I see the error “object doesn't support property or method 'matches'”, with a reference to line 35 of collapse.js in the admin package. I did some research and I found that IE11 doesn’t support the “matches” function, so I just modified the admin base template with a polyfill to get things working on my machine. But the collapsible elements were working fine with my old version of Django on IE11, so it looks like a polyfill (or something) was removed in the most recent Django version. Does anyone know what might have changed? If something was changed, I think this is a bug – we shouldn’t have to modify the templates in the admin package to use IE11.

 

This is my first post. Thanks for any comments or suggestions.


Paul

Paul Michalski

unread,
Jul 12, 2019, 4:40:55 PM7/12/19
to Django users

I can confirm this bug also occurs when using the minified file, collapse.min.js. I just updated our production server and the same bug popped up.

Mike Dewhirst

unread,
Jul 13, 2019, 8:53:14 PM7/13/19
to Django users
Are you using TinyMCE, filebrowser and Grappelli?

I had a similar problem as you describe and resorted to
django-tinymce4-lite and django-filebrowser-no-grappelli which fixed it
for me.

I haven't done any deep digging so I can't be certain why mine started
behaving properly.

Mike
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP-Fw1EC3t-%2BR86BWsJ0SvLUg1-45epCQPZzY4H6Kg2tXJtYnQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP-Fw1EC3t-%2BR86BWsJ0SvLUg1-45epCQPZzY4H6Kg2tXJtYnQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Mike Dewhirst

unread,
Jul 15, 2019, 4:18:46 AM7/15/19
to Django users
Paul

I have dug a little deeper.I am getting a warning in 2.1 ...

D:\Users\mike\envs\xxct3\lib\site-packages\django\forms\widgets.py:126: MediaOrderConflictWarning: Detected duplicate Media files in an opposite order:
admin/js/vendor/jquery/jquery.min.js
/tinymce/filebrowser/
  MediaOrderConflictWarning,

... which doesn't prevent collapsible elements collapsing.

Django 2.2 forms.widgets.merge is merging multiple lists instead of just two lists in Django 2.1 so it is possible that the innocuous warning from 2.1 becomes an unintended elimination of the particular bit of js which collapses those elements when javascript files are in the wrong sequence.

I'm guessing the actual problem in 2.2 is likely from collectstatic skipping files which already exist. Try deleting all your static files and run collectstatic again.

Mike
Reply all
Reply to author
Forward
0 new messages