Commit 5f127681 authored by kidrobot's avatar kidrobot Committed by Ra Mänd
Browse files

Issue #3043573 by hitfactory: Submitting entityform generates Notice for undefined $nid

parent 3daeb1ac
......@@ -325,11 +325,15 @@ class FieldCollectionItemEntity extends Entity {
if ($hostEntity) {
$entity_type = key($field_info['bundles']);
$bundle = current($field_info['bundles'][$entity_type]);
$entity_info = entity_get_info($entity_type);
$key = $entity_info['entity keys']['id'];
$query->entityCondition('entity_type', $entity_type);
$query->entityCondition('entity_id', $hostEntity->nid);
$query->entityCondition('entity_id', $hostEntity->{$key});
$query->entityCondition('bundle', $bundle);
if (isset($entity_info['entity keys']['language'])) {
$query->propertyCondition('language', $hostEntity->language);
}
}
$query->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT');
if (!$this->isInUse()) {
$query->age(FIELD_LOAD_REVISION);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment