Bug 25007: Check for normaalized ISBN when building Amazon link
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 27 Mar 2020 20:40:30 +0000 (20:40 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 16 Apr 2020 18:23:31 +0000 (19:23 +0100)
TO RECREATE:
-Have Amazon images turned on and local images too.
-Have a record with a local cover image
-Make sure the record has no ISBN in 020 field.
-Load detail page of that record and see that the local cover images is
 not on the right hand side like it should be but forced underneath
 'catalogue_detail_biblio' in an odd spot.
-Apply patch and reload page
-The image should be back in its normal spot

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

index a477bb4..2b5fb56 100644 (file)
         [% IF ( AdlibrisEnabled && normalized_isbn ) %]
             <a href="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]" class="adlibris-cover-big" alt="Adlibris cover image" /></a>
         [% END %]
-        [% IF ( AmazonCoverImages ) %]
+        [% IF ( AmazonCoverImages && normalized_isbn) %]
             <div id="amazon-bookcoverimg">
             <a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link">
                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" />