Browse Source

add check

Bradford Condon 6 years ago
parent
commit
5b3ee465e4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      tripal/includes/TripalEntityController.inc

+ 3 - 1
tripal/includes/TripalEntityController.inc

@@ -655,7 +655,9 @@ class TripalEntityController extends EntityAPIController {
                   FIELD_LOAD_CURRENT, $options);
               // Cache the field.
               if ($field_cache) {
-                cache_set($cfid, $entity->$field_name, 'cache_field');
+                if (property_exists($entity, $field_name)) {
+                  cache_set($cfid, $entity->$field_name, 'cache_field');
+                }
               }
               $queried_entities[$id]->{$field_name}['#processed'] = TRUE;
             }