diff --git a/modules/integration_producer/src/AbstractProducer.php b/modules/integration_producer/src/AbstractProducer.php index 2b7da56..d377fa1 100644 --- a/modules/integration_producer/src/AbstractProducer.php +++ b/modules/integration_producer/src/AbstractProducer.php @@ -143,17 +143,19 @@ public function build($entity) { // Set entity properties and fields values. $mapping = $this->getConfiguration()->getPluginSetting('mapping'); foreach (array_keys($mapping) as $field_name) { - $info = $this->getEntityWrapper()->getPropertyInfo($field_name); - foreach ($this->getEntityWrapper()->getAvailableLanguages() as $language) { - if (!isset($info['field'])) { - $this->getDocument()->setCurrentLanguage($language); - $property_value = $this->getEntityWrapper()->{$field_name}->value(); - $this->getDocument()->setField($mapping[$field_name], $property_value); - } - else { - $field_handler = $this->getFieldHandler($field_name, $language); - $field_handler->setDestinationField($mapping[$field_name]); - $field_handler->process(); + if ($this->getEntityWrapper()->__isset($field_name)) { + $info = $this->getEntityWrapper()->getPropertyInfo($field_name); + foreach ($this->getEntityWrapper()->getAvailableLanguages() as $language) { + if (!isset($info['field'])) { + $this->getDocument()->setCurrentLanguage($language); + $property_value = $this->getEntityWrapper()->{$field_name}->value(); + $this->getDocument()->setField($mapping[$field_name], $property_value); + } + else { + $field_handler = $this->getFieldHandler($field_name, $language); + $field_handler->setDestinationField($mapping[$field_name]); + $field_handler->process(); + } } } }