November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
This should have been fixed in 13.25. Can you run mdpsp_sys_CreateMetaClassProcedureAll to see if it fixes the problem for you?
@Quan - on the contrary, I think the issue was introduced when the file 10.0.26.0.sql was included, which seems to be 13.25.
Your suggestion would probably only do things worse. Current state, after upgrading to 13.25 (and now 13.28), is that we have meta fields with data type LongString (which changed SQL type from ntext to nvarchar) and with a Length of 16 ( = the length of the MetaDataType when the meta field was created). So, if we would run mdpsp_sys_CreateMetaClassProcedureAll, we would get the issue I described in the first post (ntext parameter turned into nvarchar(16)) on all mdpsp_avto_X_Update SPs, which will truncate all those parameters. This is my experience at least.
Instead, the thing I must do first is to fix all meta fields that is of type LongString and has a Length of 16. The easy way is probably to set the Length to -1 for these cases. When that is done, I can run the SP mdpsp_sys_CreateMetaClassProcedure for that meta class. This will change the parameters from ntext to nvarchar(max).
declare @MetaClassId int
select @MetaClassId = MetaClassId from MetaClass where Name = 'LineItemEx'
update mf set mf.Length = -1
from MetaField mf
inner join MetaClassMetaFieldRelation r on r.MetaFieldId = mf.MetaFieldId
inner join MetaClass mc on mc.MetaClassId = r.MetaClassId
where mc.MetaClassId = @MetaClassId and mf.DataTypeId = 32 and mf.Length = 16
EXEC mdpsp_sys_CreateMetaClassProcedure @MetaClassId
If I'm right, it means that anyone that has LongString meta fields since before 13.25 will have these issues the next time they add meta fields (or trigger mdpsp_sys_CreateMetaClassProcedure).
I see. It seems to be complicated. I will dig into this when time permits
Hi Andreas,
I think your solution can fix the issue.
You should run update for length = -1 of MetaFied table for DataTypeId = 11 (MetaDataType.Name = 'NText'), DataTypeId = 32 (MetaDataType.Name = 'LongString') and DataTypeId = 33 (MetaDataType.Name = 'LongHtmlString'). So the "WHERE" clause became:
WHERE mc.MetaClassId = @MetaClassId AND mf.DataTypeId IN(11, 32, 33) AND mf.Length = 16
Hope this help you to resolve the issue.
Best regards.
When upgrading to later versions of Episerver, the SQL scripts will include a change for MetaDataTypes. So, if you previously had a somewhat older version, you would have a MetaDataType LongString with the type ntext and length of 16. Any MetaField that used this type, would probably also have a length of 16.
Following a more recent version, the commerce update SQL file (10.0.26.0.sql) includes a statement to change the length of, for example, LongString:
So, we're now in spot where we have old meta fields with data type LongString and a length of 16, but with a meta data type with type nvarchar and length of 16. Whenever a new meta field is added, it will run the stored procedure [mdpsp_sys_CreateMetaClassProcedure], which generates other stored procedures and therefore also the signatures of these stored procedures.
In our case, it changed this signature:
... to ...
As you can see, ntext parameters was replaced with nvarchar(16) which means that those parameters will be truncated before they are stored.
This happened the first time we added a new meta field (which triggers [mdpsp_sys_CreateMetaClassProcedure]) after upgrading commerce to 13.25. Probably this can have pretty serious effect.