Bug 40651 - Item search custom field selection is not populated in shareable link
Summary: Item search custom field selection is not populated in shareable link
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Brendan Lawlor
URL:
Keywords:
Depends on: 14322
Blocks:
  Show dependency treegraph
 
Reported: 2025-08-14 12:59 UTC by Nick Clemens (kidclamp)
Modified: 2025-08-20 18:57 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 40651: Select custom search field if passed in via link (2.58 KB, patch)
2025-08-14 13:05 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40651: Add a link to manage item search fields (1.61 KB, patch)
2025-08-14 13:05 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40651: Select custom search field if passed in via link (2.63 KB, patch)
2025-08-14 15:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 40651: Add a link to manage item search fields (1.66 KB, patch)
2025-08-14 15:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 40651: Select custom search field if passed in via link (2.68 KB, patch)
2025-08-20 15:52 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 40651: Add a link to manage item search fields (1.71 KB, patch)
2025-08-20 15:52 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-08-14 12:59:10 UTC
To recreate:
1 - Browse to Administration - Item search fields
2 - Add a new search field pointing to a marc field with some known value on a record with items
3 - Browse to Item search
4 - Construct a search using your new field and search
5 - From results click 'Copy shareable link'
6 - Go to the link
7 - No results or wrong results!
8 - Edit the search
9 - Note your custom field is not selected
Comment 1 Nick Clemens (kidclamp) 2025-08-14 13:05:57 UTC
Created attachment 185391 [details] [review]
Bug 40651: Select custom search field if passed in via link

This patch checks for a custom field value and preselects it in the dropdown if present

To test:
1 - Browse to Administration - Item search fields
2 - Add a new search field pointing to a marc field with some known value on a record with items
3 - Browse to Item search
4 - Construct a search using your new field and search
5 - From results click 'Copy shareable link'
6 - Go to the link
7 - No results or wrong results!
8 - Edit the search
9 - Note your custom field is not selected
10 - Apply patch
11 - Visit the link again
12 - Correct results!
13 - Edit search
14 - Custom field is correctly selected!
Comment 2 Nick Clemens (kidclamp) 2025-08-14 13:05:59 UTC
Created attachment 185392 [details] [review]
Bug 40651: Add a link to manage item search fields

When debugging this reported issue, I didn't know where to add these fields, let's make it more
obvious for users who can manage those

To test:
1 - Be a user who can manage item search fields
    i.e. have manage_item_search_fields permission
2 - Go to item search
3 - Note a link to Manage item search fields
4 - Confirm it works
5 - Be a user without the permission
6 - Go to item search
7 - There is no link!
Comment 3 Owen Leonard 2025-08-14 15:42:44 UTC
Created attachment 185400 [details] [review]
Bug 40651: Select custom search field if passed in via link

This patch checks for a custom field value and preselects it in the
dropdown if present

To test:
1 - Browse to Administration - Item search fields
2 - Add a new search field pointing to a marc field with some known
    value on a record with items
3 - Browse to Item search
4 - Construct a search using your new field and search
5 - From results click 'Copy shareable link'
6 - Go to the link
7 - No results or wrong results!
8 - Edit the search
9 - Note your custom field is not selected
10 - Apply patch
11 - Visit the link again
12 - Correct results!
13 - Edit search
14 - Custom field is correctly selected!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Owen Leonard 2025-08-14 15:42:46 UTC
Created attachment 185401 [details] [review]
Bug 40651: Add a link to manage item search fields

When debugging this reported issue, I didn't know where to add these
fields, let's make it more obvious for users who can manage those

To test:
1 - Be a user who can manage item search fields
    i.e. have manage_item_search_fields permission
2 - Go to item search
3 - Note a link to Manage item search fields
4 - Confirm it works
5 - Be a user without the permission
6 - Go to item search
7 - There is no link!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Brendan Lawlor 2025-08-20 15:52:03 UTC
Created attachment 185591 [details] [review]
Bug 40651: Select custom search field if passed in via link

This patch checks for a custom field value and preselects it in the
dropdown if present

To test:
1 - Browse to Administration - Item search fields
2 - Add a new search field pointing to a marc field with some known
    value on a record with items
3 - Browse to Item search
4 - Construct a search using your new field and search
5 - From results click 'Copy shareable link'
6 - Go to the link
7 - No results or wrong results!
8 - Edit the search
9 - Note your custom field is not selected
10 - Apply patch
11 - Visit the link again
12 - Correct results!
13 - Edit search
14 - Custom field is correctly selected!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>




 Depends: bug xxxx 14322
Comment 6 Brendan Lawlor 2025-08-20 15:52:06 UTC
Created attachment 185592 [details] [review]
Bug 40651: Add a link to manage item search fields

When debugging this reported issue, I didn't know where to add these
fields, let's make it more obvious for users who can manage those

To test:
1 - Be a user who can manage item search fields
    i.e. have manage_item_search_fields permission
2 - Go to item search
3 - Note a link to Manage item search fields
4 - Confirm it works
5 - Be a user without the permission
6 - Go to item search
7 - There is no link!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 7 Brendan Lawlor 2025-08-20 16:00:23 UTC
This makes sense that we need to select the custom field options that are passed in the shareable link. That was not included in bug 14322 originally so I'm really happy to see this fix. 

The link to manage custom fields is also a nice addition for admins.

Thanks everyone! Passing QA.
Comment 8 Lucas Gass (lukeg) 2025-08-20 18:57:45 UTC
Nice work everyone!

Pushed to main for 25.11