django-sortedm2m
django-sortedm2m copied to clipboard
Popup for creating new entity for relational field is not closing due to js error
Django 3.1 django-sortedm2m==3.0.2
Uncaught ReferenceError: windowname_to_id is not defined
at window.<computed> (/static/sortedm2m/widget.js:105)
at popup_response.js:13
Problematic call: https://github.com/jazzband/django-sortedm2m/blob/master/sortedm2m/static/sortedm2m/widget.js#L105
Related change on Django: https://github.com/django/django/commit/f982f0bdb8317e75af416595c616943d5025da1e
Django 3.1 django-sortedm2m==3.0.2
Uncaught ReferenceError: windowname_to_id is not defined at window.<computed> (/static/sortedm2m/widget.js:105) at popup_response.js:13
Problematic call: https://github.com/jazzband/django-sortedm2m/blob/master/sortedm2m/static/sortedm2m/widget.js#L105
Related change on Django: django/django@f982f0b
Hey @fatalcoder, Did you find any workaround?
Hi, didn't search for any 'cause it's not a big deal for us. The values were updated, only the window didn't close.
You can always redefine the function that was removed from Django.
function windowname_to_id(text) {
text = text.replace(/__dot__/g, '.');
text = text.replace(/__dash__/g, '-');
return text;
}
and even simplify it to just
function windowname_to_id(text) {
return text;
}
Hi, im experiencing the same behavior but with a different JS error message:
Plus the
Delete
check box is not showing: