diff options
author | nfebe <fenn25.fn@gmail.com> | 2025-01-31 14:45:29 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-02-03 16:04:50 +0000 |
commit | ab9dbe048eb2ea818d4b6c2cf3e2d8ce47788ddc (patch) | |
tree | a3bd9ed854d5f73fed4c4fa44ffda40846ba47d0 /core/src | |
parent | 6a55819e7186529c9971053140f112c8c4919879 (diff) | |
download | nextcloud-server-ab9dbe048eb2ea818d4b6c2cf3e2d8ce47788ddc.tar.gz nextcloud-server-ab9dbe048eb2ea818d4b6c2cf3e2d8ce47788ddc.zip |
fix(unified-search): filteredProviders now inherits all provider props
The main providers come from both the backend and client side plugins such as `in-folder` search.
The main providers may carry callbacks functions and other information that should be passed to the `filteredProviders`.
This is important because the current code does not make a distinction between `filteredProviders` and `providers`
rightly so, becuase they are the same thing!
Without the mentioned distinction above, sooner or later, we try to access a property on the `filteredProviders` which we
did not transfer with the manual property copy.
----
This fix prevents in-folder search from searching everywhere when "load more results" is clicked; Essentially ignoring the in-folder
search filter.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/components/UnifiedSearch/UnifiedSearchModal.vue | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue index 08c3657ce78..74a17694cea 100644 --- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue +++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue @@ -507,6 +507,11 @@ export default defineComponent({ // If load more result for filter, remove other filters this.filters = this.filters.filter(filter => filter.id === provider.id) this.filteredProviders = this.filteredProviders.filter(filteredProvider => filteredProvider.id === provider.id) + // Plugin filters may have extra parameters, so we need to keep them + // See method handlePluginFilter for more details + if (this.filteredProviders.length > 0 && this.filteredProviders[0].isPluginFilter) { + provider = this.filteredProviders[0] + } this.addProviderFilter(provider, true) }, addProviderFilter(providerFilter, loadMoreResultsForProvider = false) { @@ -531,13 +536,8 @@ export default defineComponent({ this.filters = this.syncProviderFilters(this.filters, this.filteredProviders) } this.filteredProviders.push({ - id: providerFilter.id, - appId: providerFilter.appId, - searchFrom: providerFilter.searchFrom, - name: providerFilter.name, - icon: providerFilter.icon, + ...providerFilter, type: providerFilter.type || 'provider', - filters: providerFilter.filters, isPluginFilter: providerFilter.isPluginFilter || false, }) this.filters = this.syncProviderFilters(this.filters, this.filteredProviders) |