AI OnAI Off
That looks correct. Are you sure there's not been any changes with page type restrictions with the structure of your site that would mean errors would occur when saving. You don't have a startpage under a startpage already?
Also you could try to change the SaveAction to SkipValidation
Make sure no AvailableContentTypes defined on the startpage
[AvailableContentTypes(Include = new[] {
typeof(StartPage),
typeof(ContainerPage))]
public class SysRoot : PageData
You should use
var startPage = (StartPage)_contentRepository.Get<StartPage>(ContentReference.StartPage).CreateWritableClone();
Not
var startPage = _contentRepository.GetDefault<StartPage>(ContentReference.StartPage);
GetDefault
gives you a new instance, while Get
gives you an existing instance. No need to call CreateWriteableClone()
on the instance you get from GetDefault
either, since it's already writeable.
When i call .Save i get the error: 'Content type "StartPage" is not allowed to be created under parent of content type "StartPage"'
Im trying to update property on the StartPage but it wont let m e because it tries to create new page? I just wnat to update the existing one.