Don't build image tags for non-existing mattype icons
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 28 Jul 2011 20:46:12 +0000 (16:46 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 28 Jul 2011 20:46:12 +0000 (16:46 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/templates/default/opac/parts/misc_util.tt2

index b8e3e9c..f9ebae3 100644 (file)
@@ -48,7 +48,7 @@
         FOR icon_style IN ['mattype', 'item_type']; 
             node = xml.findnodes(
                 '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
-            IF node;
+            IF node AND node.textContent;
                 args.format_label = node.getAttribute('coded-value')
                 args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ node.textContent _ '.png';
                 LAST;