Bugzilla – Attachment 184577 Details for
Bug 40483
Searching vendors by Alias no longer works
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40483: Restore search vendors by alias
Bug-40483-Restore-search-vendors-by-alias.patch (text/plain), 2.59 KB, created by
Jonathan Druart
on 2025-07-24 08:03:39 UTC
(
hide
)
Description:
Bug 40483: Restore search vendors by alias
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-24 08:03:39 UTC
Size:
2.59 KB
patch
obsolete
>From 61402f9848744cdc9d9754e6004f8b85cce7358a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 24 Jul 2025 10:00:42 +0200 >Subject: [PATCH] Bug 40483: Restore search vendors by alias > >Prior to bug 38010 we were able to search vendors by alias. > >This patch restores it by moving the filter to kohaTable's "default_filters" to allow to pass a more complex condition > >Test plan: >Create several vendors, some with aliases >Confirm that searching by alias return the vendors >Confirm that refining the search (using the table's global search) works >as expected >--- > .../prog/js/vue/components/Vendors/VendorList.vue | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue >index b689f10db09..60ac704af03 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue >@@ -64,7 +64,6 @@ export default { > fp_config: flatpickr_defaults, > vendor_count: 0, > initialized: false, >- searchTerm: null, > tableOptions: { > columns: this.getTableColumns(), > options: { >@@ -73,6 +72,7 @@ export default { > url: () => this.tableURL(), > table_settings: this.vendorTableSettings, > add_filters: true, >+ default_filters: {}, > filters_options: { > 1: [ > { _id: 0, _str: this.$__("Inactive") }, >@@ -118,8 +118,14 @@ export default { > beforeRouteEnter(to, from, next) { > next(vm => { > vm.getVendorCount().then(() => (vm.initialized = true)); >- if (to.query.supplier) { >- vm.searchTerm = to.query.supplier; >+ const searchTerm = to.query.supplier; >+ if (searchTerm) { >+ vm.tableOptions.default_filters = { >+ "-and": [ >+ { "me.name": { like: `%${searchTerm}%` } }, >+ { "aliases.alias": { like: `%${searchTerm}%` } }, >+ ], >+ }; > } > }); > }, >@@ -183,9 +189,6 @@ export default { > }, > tableURL() { > let url = "/api/v1/acquisitions/vendors"; >- if (this.searchTerm) { >- url += "?name=" + this.searchTerm; >- } > return url; > }, > getTableColumns() { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40483
: 184577