Bug 40904 - Unable to search items by location
Summary: Unable to search items by location
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Arthur Suzuki
QA Contact: Paul Derscheid
URL:
Keywords:
Depends on: 15461 39011
Blocks:
  Show dependency treegraph
 
Reported: 2025-09-30 09:02 UTC by Arthur Suzuki
Modified: 2025-10-31 22:55 UTC (History)
6 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the holdings table in the staff interface so that it can be searched and filtered by the shelving location description.
Version(s) released in:
25.11.00,25.05.05
Circulation function:


Attachments
Bug 40904: Fix item search by shelving location on catalogue/details.pl (1.93 KB, patch)
2025-09-30 09:08 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 40904: Fix item search by shelving location on catalogue/details.pl (1.97 KB, patch)
2025-09-30 12:23 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 40904: Fix item search by shelving location on catalogue/details.pl (2.03 KB, patch)
2025-10-02 09:51 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Suzuki 2025-09-30 09:02:43 UTC
Although bug39011 have solved a lot of things regarding searching the items table on authorised_values,
it was missing the items.location mapping.
As far as I can tell there are no other missing coded_values.
Comment 1 Arthur Suzuki 2025-09-30 09:08:40 UTC
Created attachment 187076 [details] [review]
Bug 40904: Fix item search by shelving location on catalogue/details.pl

Test plan :
- before patch on ktd, go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=155
- in the holdings table search for "general" like "General Stacks".
- see that no items appear
- apply patch
- repeat the search
- all items appear now.
Comment 2 Biblibre Sandboxes 2025-09-30 12:23:52 UTC
Created attachment 187095 [details] [review]
Bug 40904: Fix item search by shelving location on catalogue/details.pl

Test plan :
- before patch on ktd, go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=155
- in the holdings table search for "general" like "General Stacks".
- see that no items appear
- apply patch
- repeat the search
- all items appear now.

Signed-off-by: Mathieu <mathsabypro@gmail.com>
Comment 3 Mathieu Saby 2025-09-30 12:28:52 UTC
BZ 39011 was categorized as a bug fix and not an enhancement. I think the same should apply to this ticket.

I tested it on a sandbox, it works, you can search for "general stacks" or "general."
"Stacks" doesn't return any results, which may seem surprising, but that's how the filter already works for libraries and statuses following 39011, so that makes sense...

But is this the desired behavior for this table or something that should be improved in subsequent bugs?
Comment 4 Mathieu Saby 2025-09-30 12:34:27 UTC
By the way I discovered an other issue while testing : 
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907
Comment 5 Paul Derscheid 2025-10-02 09:51:30 UTC
Created attachment 187246 [details] [review]
Bug 40904: Fix item search by shelving location on catalogue/details.pl

Test plan :
- before patch on ktd, go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=155
- in the holdings table search for "general" like "General Stacks".
- see that no items appear
- apply patch
- repeat the search
- all items appear now.

Signed-off-by: Mathieu <mathsabypro@gmail.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 6 Paul Derscheid 2025-10-02 09:52:15 UTC
Fixes the immediate issue so I passed QA, Bug 40907 still needs attention, though. But I think it's out of scope for this bug.
Comment 7 Paul Derscheid 2025-10-02 09:52:52 UTC
We should aim to improve on this:
> But is this the desired behavior for this table or something that should be improved in subsequent bugs?
Comment 8 Lucas Gass (lukeg) 2025-10-06 15:17:09 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 9 Arthur Suzuki 2025-10-07 09:05:01 UTC
(In reply to Paul Derscheid from comment #6)
> Fixes the immediate issue so I passed QA, Bug 40907 still needs attention,
> though. But I think it's out of scope for this bug.

Yep, have a look but parenthesis actually works but for regexp! as I told in 40907 I was not able to escape them though.
Comment 10 Paul Derscheid 2025-10-23 21:11:30 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 11 Baptiste Wojtkowski (bwoj) 2025-10-31 15:19:57 UTC
Fix the error of an enhancement (Bug 15461), not backported in 24.11.x.
Comment 12 David Nind 2025-10-31 22:55:02 UTC
Bug fix - no changes to the manual required.