Try our conversational search powered by Generative AI!

Metafield creation failure in upgrade to update 51 EPiServer.Commerce.Core.8.7.1

Vote:
 

As part of upgrading to update 51 (EPiServer.Commerce.Core.8.7.1) the SQL script 6.2.0.0.sql is executed to update the database. This includes the code to introduce new metafields including ShippingTax to the shipping object. However the scripts do not cater for a custom metafield with the same name already existing, when it does the appropriate sql is skipped and errors ensue. In our instance, at the point of adding a shipment to an order.

The sql fails as the IF statement (below) does not limit the name comparison to a namespace but compares against all metafields, the existance of a custom field with the same name prevents its creation.

IF NOT EXISTS(SELECT * FROM [dbo].[MetaField]
WHERE [Name] = N'ShippingTax')
AND EXISTS(SELECT TOP 1 MetaClassId from MetaClass WHERE Name = 'Shipment')

This leads to no visible errors, that I could spot, during the upgrade process and seems to follow the template used for adding meta fields (its the same for ProviderTransactionID and OperationKeys).

Is this deliberate as having fields with these names in multiple namespaces will cause problems, an oversite in the upgrade scripts or have I missed an obvious warning in the release notes\upgrade output?

#116810
Feb 05, 2015 10:50
Vote:
 

Hi,

I can say this is a bug. The validation is not strong enough and the naming is quite common so it's possible to have conflict between our metafields and your custom metafileds.

I'll file a bug to see how we can improve the situation.

Thank you for your feedback.

Regards.

/Q

#116821
Feb 05, 2015 13:13
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.