From 9776d591ece45b36365f69315e2c958f264bc76f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 1 May 2020 12:43:40 +0000 Subject: [PATCH] Bug 25340: Pass biblio object to OPAC comments template This patch modifies the OPAC comments system so that the biblio object is passed to the template. This allows the biblio-title include to properly access the title and subtitle information. Unrelated change: Remove some custom CSS from the page which was obsolete. To test, apply the patch and make sure the "reviewson" preference is enabled. - Log in to the OPAC and open a bibliographic record's detail page. - Under the "Comments" tab, click the "Post your comments" link to trigger the pop-up window. - In the pop-up window, verify that the item's title is correct in the page title and the heading. Author should display correctly, if present. - Test submitting a comment and editing a comment. Everything should work correctly. Signed-off-by: Sally Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../opac-tmpl/bootstrap/en/modules/opac-review.tt | 11 ++++------- opac/opac-review.pl | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt index 98248169a2..863e4ac696 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt @@ -1,8 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Comments on [% title | html %] - +[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Comments on [% INCLUDE 'biblio-title-head.inc' %] [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] @@ -42,10 +39,10 @@ [% END # / ERRORs %] -

Comments on [% INCLUDE 'biblio-title.inc' biblio=Stash.stash() %]

- [% IF ( author ) %]

[% author | html %]

[% END %] +

Comments on [% INCLUDE 'biblio-title.inc' %]

+ [% IF ( biblio.author ) %]

[% biblio.author | html %]

[% END %]
- + [% IF ( reviewid ) %][% END %]
diff --git a/opac/opac-review.pl b/opac/opac-review.pl index 86a9848ba9..6c0ac3e688 100755 --- a/opac/opac-review.pl +++ b/opac/opac-review.pl @@ -97,11 +97,10 @@ if( !@errors && defined $review ) { $review = $clean; $review ||= $savedreview->review if $savedreview; $template->param( - 'biblionumber' => $biblionumber, 'borrowernumber' => $borrowernumber, 'review' => $review, 'reviewid' => $reviewid || 0, - 'title' => $biblio->title, + 'biblio' => $biblio, ); output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5