replace undefined values with null in filters returned by get query before calling search or autocomplete
This commit is contained in:
parent
30a41df226
commit
fb7bd1c77a
2 changed files with 15 additions and 7 deletions
|
|
@ -155,11 +155,14 @@ function makeselector() {
|
|||
|
||||
if (typeof(q)==="string") {
|
||||
args.query = q;
|
||||
} else {
|
||||
// replaced $.extend(args, q)
|
||||
$.each(q, function(key, value) {
|
||||
args[key] = value;
|
||||
});
|
||||
} else if($.isPlainObject(q)) {
|
||||
if(q.filters) {
|
||||
$.each(q.filters, function(key, value) {
|
||||
q.filters[key] = value===undefined ? null : value;
|
||||
});
|
||||
}
|
||||
|
||||
$.extend(args, q);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -639,10 +639,15 @@ LinkField.prototype.make_input = function() {
|
|||
var q = me.get_custom_query();
|
||||
if (typeof(q)==="string") {
|
||||
args.query = q;
|
||||
} else {
|
||||
} else if($.isPlainObject(q)) {
|
||||
if(q.filters) {
|
||||
$.each(q.filters, function(key, value) {
|
||||
q.filters[key] = value===undefined ? null : value;
|
||||
});
|
||||
}
|
||||
$.extend(args, q);
|
||||
}
|
||||
|
||||
|
||||
wn.call({
|
||||
method:'webnotes.widgets.search.search_link',
|
||||
args: args,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue