-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS error on latest master #175
Comments
The very first error comes from Can you change that line:
And replace the ternary operation with simply Otherwise, if it does not work, you will need to provide an example code that reproduce the problem.
Yes. |
@amirouche, that didn't work. Reintroducing these lines which were removed fixes it: b8e8326#diff-1a1e3ea5b934607f6eeba01fbf28dff55ed43758ded45b83c1b89e44c26effa5L1-L3 In order to replicate the issue, these instructions can be followed: Then, make sure the latest master of django-sortedm2m is installed in the virtual env. Then, the error shows up in |
The lines removed were replaced by the ternary operator at the end, which seems to me like the correct idiom, that I picked up in Django or something like that.
I will look into this tomorrow. |
Reintroduced 3 lines which were removed in jazzband#170 but should be reintroduced for backward compatibility.
Reintroduced 3 lines which were removed in jazzband#170 but should be reintroduced for backward compatibility. Fixes jazzband#175
Yes but jQuery ui expects to find a global In the meanwhile I have opened #176, which I think it's the safest choice for maintaining backward compatibility and avoid problems in existing applications using this package. |
Yes, I have another jQuery in the global namespace.
I disagree with the backward compatibility thing. This is a bug, not a feature.
|
The solution used previously was not elegant but if we don't want to break the package we'll either have to find a better solution or rollback that change. I have not strong opinions, I only want this widget to keep working as it did in the last version. |
I do not have the time to investigate further. Apprantly you rely on django-sortedm2m to have jQuery, that is a mistake. |
I do not rely, it's the jquery-ui shipped in django-sortedm2m which expects a global jQuery. At the moment the latest master of this package seems broken to me, I highly advise to not release it to pypi until the problem is fixed to avoid breaking existing applications that rely on it. |
Sorry for the noise, I completely forgot sortedm2m rely on jqueryui! Indeed #176 must be merged before a release. |
Reintroduced 3 lines which were removed in jazzband#170 but should be reintroduced for backward compatibility. Fixes jazzband#175
Once on b8e8326, if I open the widget in the admin, the sortable feature is broken and I see the following errors in the JS console:
jquery-ui.js:6 Uncaught TypeError: Cannot read property 'ui' of undefined
jquery.js:4055 Uncaught TypeError: ul.sortable is not a function
If I reset to the previous commit I don't see the error, hence I think it was inadvertently introduced in #170.
@amirouche @clintonb @auvipy is anybody getting this error? Have you tried the latest master in one of your applications?
The text was updated successfully, but these errors were encountered: