Browse Source

Merge pull request #413 from statonlab/cache_set_check

Cache set check
Stephen Ficklin 6 years ago
parent
commit
41b4f2bdf9
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;
             }