From ca1f8409b9e5abf95570d5fb053ac202929a00f1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 5 Jun 2021 16:08:46 +0200 Subject: [PATCH] Bug 28518: Display missing inputs for "Return to the last advanced search" When more than 3 search terms are passed on the advanced search form, the "Return to the last advanced search" feature does not display them. Test plan: Perform an adv search at the OPAC, enter more than 3 terms, launch the search, click the "Return to the last advanced search" link and confirm that all the entries are there. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 75d67d46ce3df59c1460df44318439c40c14451b) Signed-off-by: Fridolin Somers (cherry picked from commit a0bd7d7c5a7b3cb6eddce02facdc0798bd9ce205) Signed-off-by: Victor Grousset/tuxayo --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt index 8302c1ad02..700fc9c410 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ -424,6 +424,11 @@ $(document).ready(function() { [% IF ( ReturnToSearch ) %] if (form_serialized = jQuery.cookie("form_serialized")) { + // Add missing term inputs if there were more than 3 + var count = (form_serialized.match(/&q=/g) || []).length; + for(var i = 3 ; i < count ; i++) { + $("a.ButtonPlus:last").click(); + } $('#advsearch form').deserialize(form_serialized); } if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) { -- 2.39.5