Summary: | Do not show the images tab in the OPAC if the record has no local cover images | ||
---|---|---|---|
Product: | Koha | Reporter: | Nicole C. Engard <nengard> |
Component: | Templates | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jcamins, jonathan.druart, melia |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
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
[Signed off] Bug 8710 - Don't show the images tab in the OPAC if the record has no local images Bug 8710 - Don't show the images tab in the OPAC if the record has no local images |
Description
Nicole C. Engard
2012-08-31 19:40:22 UTC
Created attachment 13072 [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. Created attachment 13297 [details] [review] [Signed off] 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> 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. 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> 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. This patch has been pushed to master. |