radiac / django-tagulous

Fabulous Tagging for Django
http://radiac.net/projects/django-tagulous/
Other
336 stars 66 forks source link

Autocomplete broken on Django 4 #164

Closed chrisdevilliers closed 1 month ago

chrisdevilliers commented 2 years ago

I am unable to get autocomplete working in the admin interface on Django 4. To recreate the issue, follow the README.rst from the example/ directory:

  1. Replace 3.2 with 4.0 in the line pip install "Django~=3.2".
  2. Replace url with re_path in example/urls.py and change the import line to from django.urls import re_path.
  3. Go to the admin interface and add a Person.

The Title, Skills and Hobbies fields are normal text input widgets instead of the Javascript dropdown with autocomplete feature. See the screenshot below: 2022-06-24-092618_1904x1017_scrot

Package versions:

Django          4.0.5
django-tagulous 1.3.3
jedie commented 2 years ago

I can confirm this. Seems that the static files like 'tagulous/tagulous.js' are not in HTML.

The Problem is in tagulous.forms.AdminTagWidget.media and accessing AutocompleteMixin.media Sadly: errors in media property are silent! Seems that the existing tests doesn't cover this.

EDIT: I now see that a PR already exists: https://github.com/radiac/django-tagulous/pull/158

EDIT2: The bad thing is: tagulous.forms.AdminTagWidget.media raised an (silent) error and this avoids loading all Media collections from other parts!

flbraun commented 2 years ago

@radiac Could you please take a look at this issue and the provided PRs? We have to add a lot of unstable workaround code to circumvent this issue, which is not a nice experience.

jedie commented 1 year ago

@radiac The fix was merged, but there is no new release made since the merge, isn't it? Can you please create a new release?

EDIT: Oh https://github.com/radiac/django-tagulous/pull/167 is still not merged :(

radiac commented 1 month ago

This is now fixed in v2.0 - thanks for your patience everyone!