From bfd33ed339e8bb22e85b9e8b7190db649f0f0ba0 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 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 e637321aba..2ed7d73224 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -723,6 +723,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 () {