cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

String attribute with metatype as variantAttributeDescriptor cannot render in backoffice

Former Member
0 Likes
503

Hi, We have custom item type having string attributes with meta type defined as variantAttributeDescriptor. We added this item type to explorer tree in backoffice. It works fine 5.7 hybris. In 6.6 when we try to open the custom item type in backoffice explorer tree it gives following class cast exception

 java.lang.ClassCastException: de.hybris.platform.core.model.type.ComposedTypeModel cannot be cast to de.hybris.platform.variants.model.VariantTypeModel
     at de.hybris.platform.variants.model.VariantAttributeDescriptorModel.getEnclosingType(VariantAttributeDescriptorModel.java:109) ~[models.jar:?]
     at de.hybris.platform.variants.model.VariantAttributeDescriptorModel.getEnclosingType(VariantAttributeDescriptorModel.java:1) ~[models.jar:?]
     at com.hybris.backoffice.cockpitng.dataaccess.facades.type.DefaultPlatformTypeFacadeStrategy.convertAttribute(DefaultPlatformTypeFacadeStrategy.java:422) ~[classes/:?]
     at com.hybris.backoffice.cockpitng.dataaccess.facades.type.DefaultPlatformTypeFacadeStrategy.convertType(DefaultPlatformTypeFacadeStrategy.java:355) ~[classes/:?]

I have seen the class DefaultPlatformTypeFacadeStrategy, it tries to get the enclosing type of attributeDescriptorModel to check whether it is viewModel or not. As our attribute is a string type with attributeDescriptor defined, string cannot be returned as composed Type. In 5.7 hybris doesn't have this kind of check so it works fine. For testing purpose I removed the meta type definition and it works fine in 6.6. Any idea how can we handle this?

Accepted Solutions (0)

Answers (0)