Hi fellow Oro’ers,
I’ve been trying to get a grasp at the ImportExport and Integration bundle for a new entity which I need to import from a Magento instance. So far the data is coming correctly to our OroCRM install and it will go through the processor and so on… But, the Denormalizer which I’m using should use a DateTimeNormalizer, since there is a datetime field. Oro has provided a nice serializer for it, the DateTimeNormalizer, but it will fail to process the datetime field since the field is not being imported as the DateTime::ISO8601 format.
Since OroCRM has the ability to import orders, which also has datetime fields I’m trying to recreate the same for this entity. Unfortunately the normalizer which I try to use for the datetime normalization is not being used, instead the default is being used and will throw an error at me.
The error is “Invalid datetime “xx”, expected format Y-m-d\TH:i:sO”. I do understand why this error is thrown, but what I can’t figure out is how I suppose to “overrule” the default DateTimeNormalizer. I did however register my custom datetime normalizer as a tagged service with “oro_importexport.normalizer” as a tag.
From the logging I did I see the following:
- The custom DateTimeNormalizer and the custom EntityDenormalizer are in the Normalizers array
- The custom DateTimeNormalizer is being initialised but the “denormalize” method is not being called
- The custom DateTimeNormalizer returns a 1 (true) for “supportDenormalization”
- The ConfigurableEntityNormalizer (I’ve extended this one, like the OrderDenormalizer) sees that there is a datetime field and than will use the default DateTimeNormalizer
The question is that I don’t see anything in particular which hints how the OrderDenormalizer is using the OroCRM DateTimeNormalizer instead of the default, does anyone know what and where this is happening? I’ve being trying to figure this out for a few days and cannot seem to find the answer :<.
Thanks in advance!
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.