Bug 25340: Pass biblio object to OPAC comments template
authorOwen Leonard <oleonard@myacpl.org>
Fri, 1 May 2020 12:43:40 +0000 (12:43 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 4 May 2020 07:53:37 +0000 (08:53 +0100)
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 <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt
opac/opac-review.pl

index 9824816..863e4ac 100644 (file)
@@ -1,8 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Comments on [% title | html %]</title>
-<style>
-  #custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
-</style>
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Comments on [% INCLUDE 'biblio-title-head.inc' %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% BLOCK cssinclude %][% END %]
 </head>
                             </div>
                         [% END # / ERRORs %]
 
-                        <h1>Comments on <i>[% INCLUDE 'biblio-title.inc' biblio=Stash.stash() %]</i></h1>
-                        [% IF ( author ) %]<h3>[% author | html %]</h3>[% END %]
+                        <h1>Comments on <i>[% INCLUDE 'biblio-title.inc' %]</i></h1>
+                        [% IF ( biblio.author ) %]<h3>[% biblio.author | html %]</h3>[% END %]
                         <form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
-                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
+                            <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />
                             [% IF ( reviewid ) %]<input type="hidden" name="reviewid" value="[% reviewid | html %]" />[% END %]
                             <fieldset>
                                 <textarea id="review" name="review" cols="60" rows="8">[% review | html %]</textarea>
index 86a9848..6c0ac3e 100755 (executable)
@@ -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;