From 5b21b42afa7a0cb1b68f5b0daf49bdb30052ef1b 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 --- 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 3db62831e8..5e57cce830 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ -463,6 +463,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