Only load "new" serials display if we have data
authorDan Wells <dbw2@calvin.edu>
Thu, 29 Mar 2012 21:07:23 +0000 (17:07 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 2 Apr 2012 14:18:53 +0000 (10:18 -0400)
If we try to load the "new" serials display template, but have no
data (for instance, if "Use fully compressed serial holdings" is
false), we get a server error.

Rather than wrap the whole template in an 'if', let's just not
load it.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/opac/parts/record/issues.tt2

index 585cee6..998e2d6 100644 (file)
@@ -1,4 +1,8 @@
 <div class='rdetail_extras_div'>
-    [% INCLUDE 'opac/parts/record/issues-db.tt2' # "new" serials holdings %]
+    [%
+        IF ctx.holding_summary_tree;
+            INCLUDE 'opac/parts/record/issues-db.tt2'; # "new" serials holdings
+        END;
+    %]
     [% INCLUDE 'opac/parts/record/issues-mfhd.tt2' # mfhd-based "classic" serials %]
 </div>