Explorar el Código

Merge pull request #413 from statonlab/cache_set_check

Cache set check
Stephen Ficklin hace 6 años
padre
commit
41b4f2bdf9
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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;
             }