mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
Et2SelectEmail: Fix incorrect total result, wrongly shown "No results"
This commit is contained in:
parent
9755c81a5a
commit
30238e52cd
@ -207,9 +207,22 @@ export class Et2SelectEmail extends Et2Select
|
||||
*/
|
||||
protected remoteQuery(search : string, options : object)
|
||||
{
|
||||
return this.egw().request(this.searchUrl, [search, {includeLists: this.includeLists}]).then((result) =>
|
||||
return this.egw().request(this.searchUrl, [search, {includeLists: this.includeLists}]).then((results) =>
|
||||
{
|
||||
this.processRemoteResults(result);
|
||||
// If results have a total included, pull it out.
|
||||
// It will cause errors if left in the results
|
||||
if(typeof results.total !== "undefined")
|
||||
{
|
||||
this._total_result_count += results.total;
|
||||
delete results.total;
|
||||
// Make it an array, since it was probably an object, and cleanSelectOptions() treats objects differently
|
||||
results = Object.values(results);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._total_result_count += results.length;
|
||||
}
|
||||
this._total_result_count -= this.processRemoteResults(results);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user