Skip to content

Making Item Search shareable

Monday, 08/26/2024

This idea had been around for a while, but besides a couple of comments affirming that it would be useful to library staff and support, and a list of CC's and See Also bugs, it wasn't gaining any traction.

Intuitively I knew that the item search form must somehow be passing all the parameters that it needs to perform a search to the backend where they would be transformed into a database query so that results could be returned and rendered in the template. As Michalangelo said the sculpture is already complete within the block. Item search already knows how to process search parameters and return results. All we have to do is chisel out the url encoded search parameters and Sharable Item Search will be revealed.

Creating the Copy shareable link button was pretty straightforward javascript. Then I realized that to support the Edit search button, the whole Item Search Template Toolkit would need some resculpting to render all the url parameters in the form inputs. Then JavaScript could submit the form and the Item Search would just do its thing.

🐛 14322: Add option to create a shareable link for item searches
(enhancement) Searching
Pushed to main

Like the patch that added multi select parameters to Koha reports this patch called for unconventional thinking to solve a practical problem. Fortunately this time the code seems to have been accepted as a more natural pattern. At least it hasn't been called a hack yet!