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.
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.