Browse Source

Fixed warnings in legacy templates

Chun-Huai Cheng 7 years ago
parent
commit
216d62eeaf

+ 1 - 1
legacy/tripal_library/theme/templates/tripal_library_base.tpl.php

@@ -12,7 +12,7 @@ $property = array(
   'cv_name' => 'library_property'
 );
 $libprop = chado_get_property($record, $property);
-$description = $libprop->value; ?>
+$description = isset($libprop->value) ? $libprop->value : ''; ?>
 
 <div class="tripal_library-data-block-desc tripal-data-block-desc"></div> <?php 
 

+ 3 - 0
legacy/tripal_library/theme/templates/tripal_library_properties.tpl.php

@@ -4,6 +4,9 @@ $library = $variables['node']->library;
 $options = array('return_array' => 1);
 $library = chado_expand_var($library, 'table', 'libraryprop', $options);
 $props = $library->libraryprop;
+if (!$props) {
+  return;
+}
 
 // iterate through the properties and remove the 'library_description' as it is
 // already displayed on the base template.