From edf9e65bc77f268c4c9cf66236c48432bcfe3e3f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 18 Nov 2014 09:16:53 -0500 Subject: [PATCH] Bug 13271 - Subject search links broken if XSLT and OPACPopupAuthorsSearch are both off This patch corrects some faults in the OPAC's bootstrap template which prevent additional author and subject searches from working correctly with OPACPopupAuthorsSearch both on and off. Some JavaScript has been removed because it was used only by the prog theme and is obsolete. Locate a title with multiple subjects and additional authors. Test the following conditions: OPACXSLTDetailsDisplay is blank and OPACPopupAuthorsSearch is off: - Clicking an additional author or subject link should directly trigger the correct search without an JavaScript error. OPACXSLTDetailsDisplay is blank and OPACPopupAuthorsSearch is on: - Clicking an additional author or subject link should trigger a modal window where you can select options for searching. Checking boxes and submitting the form should perform the correct search. OPACXSLTDetailsDisplay is set to "default" and OPACPopupAuthorsSearch is on OR off: - Clicking an additional author or subject link should directly trigger the correct search without an JavaScript error. (OPACPopupAuthorsSearch only works with the non-XSL view). For extra credit: Test with JavaScript disabled and confirm that link still work correctly. Signed-off-by: Frederic Demians I confirm the bug and the solution. Before various JS errors: "ReferenceError: e is not defined" and "ReferenceError: showSubjects is not defined". After: Comforting silence, and functionnality. --- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 30 ++++++++++------------ 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 52089b1..28a3686 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -154,7 +154,7 @@ @@ -164,9 +164,14 @@ [% authorsloop = loop %] [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] [% MARCAUTHOR_SUBFIELDS_LOO.separator %] - [% MARCAUTHOR_SUBFIELDS_LOO.value %] + [% ELSE %] + [% MARCAUTHOR_SUBFIELDS_LOO.value %] + [% END %] [% END %] [% IF (MARCAUTHOR.authoritylink) %] @@ -281,7 +286,11 @@ [% subjectsloop = loop %] [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] [% SUBFIELD.separator %] - [% SUBFIELD.value %] + [% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %] + [% SUBFIELD.value %] + [% ELSE %] + [% SUBFIELD.value %] + [% END %] [% END %] [% IF (MARCSUBJCT.authoritylink) %] @@ -1745,25 +1754,12 @@ //