diff --git a/src/Divante/MagentoIntegrationBundle/Service/MapperService.php b/src/Divante/MagentoIntegrationBundle/Service/MapperService.php index 3b460b0..4fa2922 100644 --- a/src/Divante/MagentoIntegrationBundle/Service/MapperService.php +++ b/src/Divante/MagentoIntegrationBundle/Service/MapperService.php @@ -218,13 +218,16 @@ private function getAllFieldDataChilds($field) */ protected function getOptionsForSelect(string $elementName, Concrete $object) { - $localizedFieldsArray = $object->getClass()->getFieldDefinition('localizedfields')->getReferencedFields(); - $localizedFieldsArray[] = $object->getClass()->getFieldDefinition('localizedfields'); - foreach ($localizedFieldsArray as $localizedFields) { - $dataFields = $this->getAllFieldDataChilds($localizedFields); - foreach ($dataFields as $field) { - if ($field->name == $elementName) { - return $field->getOptions(); + $localizedFields = $object->getClass()->getFieldDefinition('localizedfields'); + if ($localizedFields) { + $localizedFieldsArray = $localizedFields->getReferencedFields(); + $localizedFieldsArray[] = $localizedFields; + foreach ($localizedFieldsArray as $localizedFields) { + $dataFields = $this->getAllFieldDataChilds($localizedFields); + foreach ($dataFields as $field) { + if ($field->name == $elementName) { + return $field->getOptions(); + } } } }