Open krompaco opened 1 year ago
Very strange issue. Does this not working only for nullable TimeSpans (TimeSpan?) or for non-nullable too (TimeSpan)?
Tried removing the ?-marks. Still get a similar error:
warn: EPiServer.Construction.Internal.PropertyDataFactory[0]
Unable to create a PropertyData instance of Type: 'AdvancedCms.TimeProperty.TimeProperty' Assembly: 'AdvancedCms.TimeProperty'. Will fallback using the data type instead.
fail: EPiServer.Framework.Cache.ObjectInstanceCacheExtensions[0]
Failed to Read cacheKey = 'EPContentVersion:25046_52145'
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.TimeSpan'.
Also tried with that in place on a non-upgraded database with same result.
Console shows this so it there is a detection of that a change is needed, is this correct?
peModelRegister.ValidateChangeOfModelType(PropertyDefinitionModel propertyModel, String modelName)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeModelRegister.SetStateForPropertyDefinitionModels(ContentTypeModel model)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeModelRegister.<AnalyzeProperties>b__15_0(ContentTypeModel model)
I see what the problem is in this code base... I could spot it by comparing databases and deleting all values.
SELECT * FROM tblContentProperty WHERE fkPropertyDefinitionID IN (SELECT pkID FROM tblPropertyDefinition WHERE fkPropertyDefinitionTypeID = 1078)
SELECT * FROM tblWorkContentProperty WHERE fkPropertyDefinitionID IN (SELECT pkID FROM tblPropertyDefinition WHERE fkPropertyDefinitionTypeID = 1078)
-- See what happens if I delete
DELETE FROM tblContentProperty WHERE fkPropertyDefinitionID IN (SELECT pkID FROM tblPropertyDefinition WHERE fkPropertyDefinitionTypeID = 1078)
DELETE FROM tblWorkContentProperty WHERE fkPropertyDefinitionID IN (SELECT pkID FROM tblPropertyDefinition WHERE fkPropertyDefinitionTypeID = 1078)
-- After starting up (successfully) I now find the values I add on a new fkPropertyDefinitionTypeID
SELECT * FROM tblContentProperty WHERE fkPropertyDefinitionID IN (SELECT pkID FROM tblPropertyDefinition WHERE fkPropertyDefinitionTypeID = 1105)
SELECT * FROM tblWorkContentProperty WHERE fkPropertyDefinitionID IN (SELECT pkID FROM tblPropertyDefinition WHERE fkPropertyDefinitionTypeID = 1105)
Showing the difference between where the values were put between databases and after deleting for 12-db I see that I have a namespace name change I need to handle.
Any advice on how to change from "AdvancedCms.TimeProperty" to "Advanced.CMS.TimeProperty"?
Oh... I guess a manual sql update script would be needed. We changed the namespace between .net framework and .net core so it was a breaking change release.
For reference I ran this from Startup. Seems to have done the job.
UPDATE tblPropertyDefinitionType SET TypeName = 'Advanced.CMS.TimeProperty.TimeProperty', AssemblyName = 'Advanced.CMS.TimeProperty' WHERE AssemblyName = 'AdvancedCms.TimeProperty'
Hi!
I have a database that was upgraded from CMS 11 and 1.0.0 version.
I believe 3.0.1 was not configured correctly on first startup if could matter but I have 3.0.1 and properties in one local block that looks like this.
I have
services.AddTimeProperty();
in Startup.cs and when I start under these conditions I get these errors logged and app fails to start.If I comment out the properties and Startup-line the site starts correctly.
Any ideas on what I can try?