﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32823	Cannot pass extra AJAX settings to admin autocomplete	Seb G	nobody	"This ticket is partly linked to #32628 where the bug was reported along with a feature request and got ignored.

----

The provided JS function `$.fn.djangoAdminSelect2(options)` allows user to provide extra options that will be passed to `select2`. But passing extra AJAX options does not work as it rewrites the whole `ajax` option object instead of extending it.

Example failing call:

{{{
#!javascript
$(#my-select).djangoAdminSelect2({
    ajax: {
        processResults: function (data) {
            console.log(""Foo"")
            return data
        }
    }
});
}}}

This call fails because passing an `ajax` object to `$.fn.djangoAdminSelect2` erases the whole default `ajax` object including the required `ajax.data` default option.

This failure is caused by the non-recursive call to `$.extend` and can be easily resolved by adding the recursive parameter to it.

I am available to PR this one quickly if accepted."	New feature	closed	contrib.admin	3.2	Normal	duplicate	autocomplete		Unreviewed	0	0	0	0	0	0
