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,10 +325,14 @@ 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);
$query->propertyCondition('language', $hostEntity->language);
if (isset($entity_info['entity keys']['language'])) {
$query->propertyCondition('language', $hostEntity->language);
if (!$this->isInUse()) {
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