Bug 23527: BakerTaylorBookstoreURL is converted to escaped characters by template...
authorDavid Kuhn <techservspec@gmail.com>
Sat, 31 Aug 2019 23:23:16 +0000 (16:23 -0700)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 19 Feb 2020 11:10:50 +0000 (11:10 +0000)
Changing the template toolkit filter for rendering the value of
BakerTaylorBookstoreURL in opac-detail.tt and opac-results.tt from uri
to url fixes the problem.

To test (requires a Baker & Taylor username and password):

1. Enter the B&T url into BakerTaylorBookstoreURL.
2. Set BakerTaylorEnabled to "add" and enter your username and password.
3. Look up a title in the OPAC.
4. Locate a title with a cover image.
5. Click on the cover image. You are not redirected to the url stored
   in BakerTaylorBookstoreURL.
6. Display the full record for the title
7. Click on the cover image. You are not redirected to the url stored
   in BakerTaylorBookstoreURL.
8. Apply the patch.
9. Refresh the OPAC display.
10. Click on the cover image. You are now redirected to the specified url.
11. Return to the results list.
12. Click on a cover image. You are now redirected to the specified url.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Although I don't have valid Baker & Taylor credentials I was able to use
dummy data to verify that the links in the template are correctly
encoded with this patch.

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-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt

index 9961b4d..d3b4493 100644 (file)
@@ -92,9 +92,9 @@
                     [% IF ( BakerTaylorEnabled && bt_id ) %]
                         [% IF BakerTaylorBookstoreURL %]
                             [% IF ( OPACURLOpenInNewWindow ) %]
-                                <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]" target="_blank" rel="noreferrer"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
+                                <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]" target="_blank" rel="noreferrer"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
                             [% ELSE %]
-                                <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
+                                <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
                             [% END %]
                         [% ELSE %]
                             <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
index ba46f95..a9bf805 100644 (file)
                                                     [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %]
                                                         [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
                                                         [% IF ( bt_id ) %]
-                                                            <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]">
+                                                            <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
                                                             </a>
                                                         [% ELSE %]