#32659: Autocomplete field: The results could not be loaded.
-------------------------------+--------------------------------------
     Reporter:  honyczek       |                    Owner:  nobody
         Type:  Bug            |                   Status:  closed
    Component:  contrib.admin  |                  Version:  3.2
     Severity:  Normal         |               Resolution:  needsinfo
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by ml):

 The reason for this behavior is a change in the Javascript code in the
 file contrib/admin/static/admin/js/autocomplete.js from version 3.1 to 3.2
 (see below).

 In addition to running {{{./manage.py collectstatic}}} it is also
 necessary to refresh the browser cache. That can be done by going to the
 address {{{<site>/static/admin/js/autocomplete.js}}} and clicking Reload.

 autocomplete.js in v3.1:
 {{{
 'use strict';
 {
     const $ = django.jQuery;
     const init = function($element, options) {
         const settings = $.extend({
             ajax: {
                 data: function(params) {
                     return {
                         term: params.term,
                         page: params.page
                     };
                 }
             }
         }, options);
         $element.select2(settings);
     };
 }}}

 autocomplete.js in v3.2:
 {{{
 'use strict';
 {
     const $ = django.jQuery;
     const init = function($element, options) {
         const settings = $.extend({
             ajax: {
                 data: function(params) {
                     return {
                         term: params.term,
                         page: params.page,
                         app_label: $element.data('app-label'),
                         model_name: $element.data('model-name'),
                         field_name: $element.data('field-name')
                     };
                 }
             }
         }, options);
         $element.select2(settings);
     };
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32659#comment:15>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.21d0ef8fe46d8bc3cb6d24451229936c%40djangoproject.com.

Reply via email to