How to Solve Meta field Truncation Issue

  • Updated

Meta fields in Commerce get truncated.

Before Commerce 13.22, LongString has only 16 chars. ( Length = 16 in MetaField table)

Starting from Commerce 13.22, LongString has been upgraded to nvchar(max) (Length = -1 in MetaField table)

Any old meta field with metadata type LongString (created before Commerce 13.22) still has Length = 16 in the MetaField table. Whenever a new meta field is added, it will trigger a stored procedure which will result in truncation of the new data to 16 for those old LongString fields. 

This is a bug and has been fixed in Episerver.Commerce.Core 13.31.0. 



The short-term solution:

The customer updates the value of the Length field from 16 to -1 for LongString (DataTypeId=32) in the MetaField table in the Commerce database. 

Update MetaField
Set Length = -1
Where DataTypeId=32 -->for LongString type

Recommended long-term solution:

Upgrade to Commerce 13.31.0