DivanteLtd / pimcore-magento2-bridge

Pimcore module for Magento 2 integration
35 stars 24 forks source link

Unable to map localized fields in ObjectBrick #37

Closed nwijnNobears closed 4 years ago

nwijnNobears commented 4 years ago

Currently we are working on a PIM project (Pimcore 6.3.6) that uses localized fields heavily. Underneath a simplified example of how our Product Class definition looks like.

product

general

localizedfields

name attributes ObjectbrickTypeA localizefields

supplierName MultiSelectTags

We followed the mapping using xdebug and came across a bug when using the localizefield in a Objectbrick.

For the localized fields the mapping is done by the "MapStructuredValue" class. And the objectBricks are mapped by "MapObjectBricks" class.

Our products are mapped according the structure MapObjectBricks which goes into MapStructuredValue for ObjectbrickTypeA. In the structured value a ClassDefinition is selected to retrieve it's fields. When the mapper is inside the ObjectbrickTypeA the class name parent class 'Product' is used instead of the objectbrick name. Because of this the mapper is unable to get the fields for the object brick and throws an error getFieldDefinitions() on null.

mbolka commented 4 years ago

@nwijnNobears Thank you for your issue. I have resolved that is this mege: https://github.com/DivanteLtd/pimcore-magento2-bridge/pull/39 Version 1.2.2 has fix this implemented