Reputation: 573
Im currently using N2CMS to create a website however I am having the below issue.
I have a page where I have a list of images:
[EditableChildren("SliderImageItem", "SliderImageItem", 150)]
public virtual IList<SliderImageItem> SliderImages
{
get
{
return GetChildren<SliderImageItem>("SliderImageItem");
}
}
The code for the SliderImageItem:
[PartDefinition("Image", Description = "", SortOrder = 0)]
[AllowedZones("SliderImageItem")]
public class SliderImageItem : N2.ContentItem, IPart
{
public string Summary
{
get { return ""; }
}
public override bool IsPage
{
get { return false; }
}
public virtual string getLargeImage
{
get { return N2Helper.getLargeImage(SliderImage); }
}
[FileAttachment, EditableFileUploadAttribute("Slider Image", 50)]
public virtual string SliderImage
{
get { return (string)GetDetail("SliderImage") ?? string.Empty; }
set { SetDetail("SliderImage", value, string.Empty); }
}
}
My issue is that whenever I create a page and add the item immediately, it throws a StackOverflowException, which probably means there is an infinite loop somewhere. The strange thing is that when I first save the item and then go back to add the image list item, it works. Could it be cause the page doesnt yet have an ID and does not have a reference to bind it with?
I have looked and also made reference from the Github project with little luck. Is there something I am missing?
Thanks for any help.
Upvotes: 0
Views: 567