From 4414bc0d30ce8e0a293e7c9af45daa0ef708b0b9 Mon Sep 17 00:00:00 2001 From: Kevin Carnes Date: Tue, 24 Feb 2026 13:15:05 +0100 Subject: [PATCH] Bug 41496: Update current URL for item search The "Copy shareable link" button on the item search table creates a link based on the current URL, but an item search does not update the current URL with the search parameters. This patch copies the code to generate the URL with search parameters and uses it to update the current URL. Test plan: 1. Click "Item search". 2. Perform an item search (e.g. Home library is Centerville). 3. Click the "Copy shareable link" button on the right side of the screen above the table. 4. Paste and visit the link. 5. Observe that you only see the search page without any results. 6. Apply patch. 7. Repeat steps 1-4. 8. Observe that you see the results with the table settings. 9. Sign off. Sponsored-by: Lund University Library Signed-off-by: Andrew Fuerste Henry Signed-off-by: Laura_Escamilla --- .../prog/en/modules/catalogue/itemsearch.tt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 7e0a947f5e7..9e08f710761 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -726,6 +726,15 @@ prepSelections(); $('[data-bs-toggle="tooltip"]').tooltip(); }); + + let shareable_params = params.map(p => { + if(p.name === 'format') { + return { ...p, value: 'shareable' }; + } + return p; + }); + let shareable_url = window.location.origin + window.location.pathname + '?' + $.param(shareable_params); + history.replaceState(null, "", shareable_url); } $(document).ready(function () { -- 2.39.5