Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How to return the "Missing" properties

Vote:
 

Hello everyone,

We have a page in the project that contains 2 properties:

[Display(
GroupName = Global.GroupNames.Header,
Order = 101)]
public override string SiteTitle { get; set; }

[Display(
GroupName = Global.GroupNames.Header,
Order = 102)]
public override string SiteSubTitle { get; set; }

Which are overriden from

[Ignore]
public virtual string SiteTitle { get; set; }

[Ignore]
public virtual string SiteSubTitle { get; set; }

The problem is that at Admin - Content types these properties are marked as "Missing".

Here are the changes that were made with code since it had been working, may be it would be helpful:

- EPiServer upgrade from 7.1 to 7.5

- EPiServer upgrade from 7.5 to 8.11

- the captions of the properties were moved to the resource file (the only change made for these two properties)

There were no another changes - no properties deleting or renaming. And I don't exactly know at what step we lost that two.

My question is if there is any "easy" way to return these properties back? To create new and set up them again is not a good solution in our case. CMS stores "the lost" values, but I cannot get it from code, how to "map them back"?

Many thanks,

Marharyta

#139397
Oct 01, 2015 13:04
Vote:
 

Hi Marharyta,

If you set the properties as [ignore] then it will be ignored by EPiServer. I think that is why it shows as missing. Do you know why the two propeties are set as ignored?

http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/7/Content/Pages-and-Blocks/Attributes/

Ignore Defines if the property should be ignored. By default all properties are included in a content type, you can use this attribute to tell the system to ignore this property.
#139399
Oct 01, 2015 13:30
Vote:
 

Hi Toni,

Really, I removed [Ignore] attribute - and the issue is fixed! However, when I've got the project of 7.1 EPiServer version, it worked with this [Ignore] attribute. Seems that it's some king of breaking change of CMS upgrade.

Thank you for the help!

#139400
Oct 01, 2015 13:47
Vote:
 

The Ignore attribute tells EPiServer to ingore the properties completely. If you still want to have them in the model and in the database, but not show them in the UI, you can mark them with [ScaffoldColumn(false)] instead.

#139438
Oct 02, 2015 9:57
Vote:
 

Great answer, thanks Johan!

#139439
Oct 02, 2015 10:00
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.