Try our conversational search powered by Generative AI!

Commerce 14 (.Net 5) - Making Product property [CulturueSpecific] issue

Vote:
 

I've implemented a custom Product class that inherits from EPiServer.Commerce.Catalog.ContentTypes.ProductContent.

    public class Product : EPiServer.Commerce.Catalog.ContentTypes.ProductContent
    {
          //My custom properties
    }

I have previously implemented a property which was not culture specific.

        [Display(Name = "Keywords")]
        [Editable(IsEditable)]
        public virtual string Keywords { get; set; }

A few days later I've realised that this property should be culture specific so I've added a [CultureSpecifc] attribute to it

        [CultureSpecific]
        [Display(Name = "Keywords"]
        [Editable(IsEditable)]
        public virtual string Keywords { get; set; }

Currently I have no products at all in my commerce catalog, however, after performing this change I get the following Exception during site initialization:

InnerException	{"The property 'Keywords' was found on multiple content types, but with different attribute CultureSpecific values.To ignore those mismatches, add a setting with name \"episerver.commerce:IgnorePropertyAndMetafieldMisMatch\", and value to true. However, proceed with caution! "}	System.Exception {System.InvalidOperationException}

Is there any way to force a property that already has been created to become CultureSpecific?

Thanks!

#276124
Mar 11, 2022 15:28
Vote:
 

I think I might've found the cause, I had different ContentType type (Variation) which also had a Keywords property. Making it have a different name seems to solve the issue somehow.

#276126
Mar 11, 2022 15:34
Vote:
 

Yes exactly. Glad you fixed your issue, but the error message could be better (I wrote it actually). I will take a look on how to improve it.

#276127
Mar 11, 2022 16:14
Vote:
 

Yeah, it took me a while before I understood what the error message was actually trying to say. It would very helpful if the error message could say specifically which content types that have the issue.

#276309
Mar 14, 2022 6:56
Vote:
 

I looked into it, and unfortunately changing the log message to be more helpful would be not trivial. I completely agree that it should be more informative, but we'll have to live with it for now 

#276321
Mar 14, 2022 11:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.