Bugzilla – Attachment 182674 Details for
Bug 39427
Searching lists table by owner can only enter firstname or surname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39427: Split the argument for both name fields to be searched
Bug-39427-Split-the-argument-for-both-name-fields-.patch (text/plain), 1.33 KB, created by
Laura Escamilla
on 2025-05-20 13:13:12 UTC
(
hide
)
Description:
Bug 39427: Split the argument for both name fields to be searched
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-05-20 13:13:12 UTC
Size:
1.33 KB
patch
obsolete
>From d6ee2fc379dd030705972391f2ea276f7d3323ed Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Tue, 20 May 2025 13:02:48 +0000 >Subject: [PATCH] Bug 39427: Split the argument for both name fields to be > searched > >--- > C4/Utils/DataTables/VirtualShelves.pm | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/C4/Utils/DataTables/VirtualShelves.pm b/C4/Utils/DataTables/VirtualShelves.pm >index 4b578e4f70..80f18a61da 100644 >--- a/C4/Utils/DataTables/VirtualShelves.pm >+++ b/C4/Utils/DataTables/VirtualShelves.pm >@@ -63,9 +63,19 @@ sub search { > push @args, "%$shelfname%"; > } > if ( defined $owner and $owner ne '' ) { >- push @where_strs, '( bo.firstname LIKE ? OR bo.surname LIKE ? )'; >- push @args, "%$owner%", "%$owner%"; >+ my @name_parts = split ' ', $owner; >+ >+ if ( @name_parts == 2 ) { >+ push @where_strs, '( bo.firstname LIKE ? AND bo.surname LIKE ? )'; >+ push @args, "%$name_parts[0]%", "%$name_parts[1]%"; >+ >+ } else { >+ >+ push @where_strs, '(bo.firstname LIKE ? OR bo.surname LIKE ?)'; >+ push @args, "%$owner%", "%$owner%"; >+ } > } >+ > if ( defined $sortby and $sortby ne '' ) { > push @where_strs, 'sortfield = ?'; > push @args, $sortby; >-- >2.39.5
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 39427
:
182674
|
182675
|
183097
|
183130
|
183131
|
183455
|
183456
|
183465
|
183466