Try our conversational search powered by Generative AI!

New properties on ContentType not showing in CMS

Vote:
 

Since upgrading our 6r2 site to 7.5, we've intermittently had problems whereby if we add a property to a ContentType, it does not exist in the CMS. If I then go into Admin mode and add the property manually, it will 'wake up' and become available as per the definition in the code. 

However, if I have set it up manually with a different type to that of the property in the code, it will then tell me "Offline, can't save" whenever I populate it with a value. 

Once I have set it up manually, it tells me the following when I try to update it:

                  "Changes in the model for this page type were ignored because its version(0.0.0.0) is lower than version in the database(1.1.0.1723)."

The latest victims are these two properties...

[UIHint("DropDownList")]
[BackingType(typeof(PropertyString))]
[Display(Name = "Product Class",
Description = "",
Order = 105,
GroupName = "Information")]
[SelectOne(SelectionFactoryType = typeof(ProductClassSelectionFactory))]
public virtual string ProductClass { get; set; }

[Display(Name = "Quote panel",
Description = "",
Order = 210,
GroupName = "Information")]
public virtual PageReference ReturningCustomerConfigurationPage { get; set; }

Totally stumped by this. 

#118414
Mar 05, 2015 17:04
Vote:
 

Hi

I think the clue here is this message:

"Changes in the model for this page type were ignored because its version(0.0.0.0) is lower than version in the database(1.1.0.1723)."

What that means is that the content type was previously synched from assembly containing your model class that had a greater version (1.1.0.1723) than what it has now(0.0.0.0). So I would look into what versions your are setting on the assemblies that contains your content types.

The reason the check exists is to prevent the case where an older version of an assembly was accidently uploaded to a site, damaging it.

Regards

Per Gunsarfs

#118415
Mar 05, 2015 17:14
Vote:
 

Thanks, seems reasonable.. I'm not sure where this assembly version would be stored and how it's suddenly back at 0.0.0.0 though?

#118416
Mar 05, 2015 17:15
Vote:
 

It's usually managed by an AssemblyVersion attribute, somewhere in your source code, like the AssemblyInfo.cs that usually can be found under properties of a project. It should look something like this:

[assembly: AssemblyVersion("1.2.3.4")]

I assume that if that would have been removed it would default to 0.0.0.0.

/Per G

#118417
Mar 05, 2015 17:24
Vote:
 

Interesting... I've found that the problem is in my local environment, this value is uaually set to 0.0.0.0 by default. However, in the past at some point we have restored a database from our live environment which had a higher version, hence the version locally will always be lower than the version in the database. 

Where is this version number stored? I can find a work around if I can find where it's getting the page type version from. Thanks for your help :)

#118442
Mar 06, 2015 10:25
Vote:
 

I think it checks against the information found in the ModelType column of tblContentType. You could update the information there, but I always suggest to be very careful when doing direct updates in the DB. The other solution is of course to set an explicit higher version in your local environment.

/Per G

#118447
Mar 06, 2015 11:13
* 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.