Closed shacker closed 2 years ago
No one else is encountering this? Any theories?
@shacker This appears to be an issue with the minified version (adminsortable2.min.js) the un-minified version works as expected.
As a temp work around add below code to your admin class that inherits SortableAdminMixin
which will remove min from the file path name which is applied when DEBUG = False as per SortableAdminBase - adminsortable2/admin.py line 66.
@property
def media(self):
css = {"all": ["adminsortable2/css/sortable.css"]}
js = ["adminsortable2/js/adminsortable2.js"]
return super().media + widgets.Media(css=css, js=js)
@Eccleshall thanks for looking at this problem. What do you think, shall I refer to the unminimized version only?
@Eccleshall @jrief Thanks for the confirmation! I can live with the workaround until the next release. Cheers!
Simply copying the unminified version over the minified also works fine and doesn't need code changes. When a release with a fix is available manage.py collectstatic will switch back to the minified version (assuming the next version contains a fix, thought 2.0.5 would do, but seems not).
Minimizing the JS file has been built into the deployment script. I hope this will fix it.
Sorry to say, updated to 2.1.2, but this issue still appears. After copying the unminified version to the minified the error is gone. Before that i deleted the browser cache, reinstalled the library, "force updated" the site and so on.
Fixed in version 2.1.3 by using terser instead of uglify.
admin-sortable2 2.0.4 in my project works fine on localhost. But deployed to a server, the second I touch a drag handle, the console shows this error:
And ordering changes are not saved. Whatever
t
is, it's undefined! I've confirmed that/static/adminsortable2/js/adminsortable2.min.js
is definitely loading, with a 200.Is this a bug, or could I have misconfigured something?