From e1bfdad900674c4f9e4859cfdd11cb6c19209318 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Fri, 24 Jun 2011 10:44:43 -0400 Subject: [PATCH] Fix broken images for items without ISBNs in search results The search results code happily sets the src attribute of the cover image to an empty string (as returned by cleanISBN()) if currentISBN has not been defined (which is generally the case if an item doesn't have an ISBN, such as a DVD or a thesis or an old book). Protect against the empty string and set the src attribute to '/opac/images/blank.png' to avoid broken image indicators in search results. Signed-off-by: Dan Scott Signed-off-by: Mike Rylander --- Open-ILS/web/opac/skin/default/js/result_common.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index 6a5d8c3024..31edb3bec9 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -501,8 +501,12 @@ function resultDisplayRecord(rec, pos, is_mr) { } catch(e){ } */ - var pic = $n(r, config.names.result.item_jacket); - pic.setAttribute("src", buildISBNSrc(currentISBN)); + var pic = $n(r, config.names.result.item_jacket); + if (currentISBN) { + pic.setAttribute("src", buildISBNSrc(currentISBN)); + } else { + pic.setAttribute("src", "/opac/images/blank.png"); + } var title_link = $n(r, config.names.result.item_title); var author_link = $n(r, config.names.result.item_author); -- 2.11.0