Bug 8710 - Do not show the images tab in the OPAC if the record has no local cover images
Summary: Do not show the images tab in the OPAC if the record has no local cover images
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-31 19:40 UTC by Nicole C. Engard
Modified: 2013-05-23 06:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8710 - Don't show the images tab in the OPAC if the record has no local images (2.67 KB, patch)
2012-10-26 13:26 UTC, Owen Leonard
Details | Diff | Splinter Review
[Signed off] Bug 8710 - Don't show the images tab in the OPAC if the record has no local images (2.69 KB, patch)
2012-11-08 00:31 UTC, Melia Meggs
Details | Diff | Splinter Review
Bug 8710 - Don't show the images tab in the OPAC if the record has no local images (2.75 KB, patch)
2012-11-26 15:53 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2012-08-31 19:40:22 UTC
In the opac if the library allows local cover images, the images tab shouldn't show unless there are local cover images on the title.
Comment 1 Owen Leonard 2012-10-26 13:26:01 UTC Comment hidden (obsolete)
Comment 2 Melia Meggs 2012-11-08 00:31:45 UTC Comment hidden (obsolete)
Comment 3 Melia Meggs 2012-11-08 00:34:15 UTC
Before applying this patch, all records had an images tab regardless of whether they actually had a local cover image.  After applying the patch, only the patches with an image have an images tab, and the local cover image displays correctly.  I am signing off.
Comment 4 Jonathan Druart 2012-11-26 15:53:10 UTC
Created attachment 13684 [details] [review]
Bug 8710 - Don't show the images tab in the OPAC if the record has no local images

For unknown reasons, having ListImagesForBiblio return undef
when there are no images still results in a variable being passed
to the template which evaluates as true, with a size of 1.

This patch alters ListImagesForBiblio to remove the "return undef"
condition, allowing the template to evaluate images as false
and show no tab.

To test, turn on local cover images and view records in the OPAC
which do and do not have cover images attached. Images should
display as expected when present, and no images tab should appear
on records which have none.

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Jonathan Druart 2012-11-26 15:56:39 UTC
QA Comments:

Caused by an array context, the previous test was always true (@image = [undef]).
This patch fixes this ergonomic issue.
Works as expected.

Marked as Passed QA.
Comment 6 Jared Camins-Esakov 2012-11-28 23:59:07 UTC
This patch has been pushed to master.